2018年4月3日 星期二

git

[下載篇]
$ git clone https:/xxx./xxx.git
$ git checkout dev

[提交篇]
$ git add <file>
$ git status
$ git commit -m "description"
$ git push

建立dns_caa branch
$ git checkout -b dns_caa
($ git branch dns_caa)
($ git checkout dns_caa)

[合併篇]
branch: master / dev / dns_caa
dns_caa branch合併到dev branch
$ git checkout dev
Already on 'dev'
Your branch is up-to-date with 'origin/dev'.
$ git merge dns_caa
($ git merge origin/dns_caa)
Performing inexact rename detection: 100% (92832/92832), done.
Auto-merging host/doc/Makefile.in
CONFLICT (content): Merge conflict in host/doc/Makefile.in
Automatic merge failed; fix conflicts and then commit the result.
git status

[還原篇]
A->B->C->D->E
某個檔案要還原到之前C版本
$ git log -p <file>
$ git checkout <commit id> <file>

要還原到之前C版本
$ git log
$ git revert <commit id>

commit id: XXXXXX
e.g. 7478a4

沒有留言:

張貼留言