常用git 指令

常用git 指令

git config --global user.name xxx

git config --global user.email xxx

git config --global color.ui true

git config --global alias.chp cherry-pick

git config --global alias.ch checkout

git config --global alias.co commit

git config --global alias.st status

git config --global alias.br branch




- create local tag $git tag mytag - push local tag to remote $git push origin mytag - push all local tag to remote $git push origin --tags #git add file line by line $ git add yourfile -p # update all local tag from remote 1.先移除原本local $git tag -l | xargs git tag -d 2. fetch remote $ git fetch -t #git log head 3條 $git log HEAD -3 --oneline > changelog # 暴力更新法 -> $git reset --hard SHA-ID $git push -f #Find branches the commit is on git branch --contains <commit> #find branchs contain tag git branch --contains tagname #list remote tag git ls-remote --tags /url/to/upstream/repo or git ls-remote --tags remotename #push local branch to remote $git push -u origin feature/DKAHR-652 #從某個tag 分支出來 git checkout tags/<tag_name> -b <branch_name> ex: $ git checkout tags/android-10.0.0_r25 -b my_android-10.0.0_r25



若要改某一條的commit message: $ git rebase -i "該條的 commit id"

接著按照需求修改即可,這邊我們需要的是reword因此,把pick改成r,改完之後用git push -force 更新原本的commit message






張貼留言

0 留言