您的位置:首页 > 其它

Git常用命令

2015-10-23 06:40 465 查看



Branch

git branch <new-branch> 创建新branch

git checkout <branch> 切换branch

git checkout -b <new-branch> 创建并切换到新branch

Commit to local repo andpush to branch
git commit -m"commit comment"

git push origin<branch>

Diff

git difftool

配置difftool使用Beyond Compare

git config --global diff.tool bc4

git config --global difftool.bc4.cmd '\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"'



git config --global merge.tool bc4

git config --global mergetool.bc4.cmd '\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"'

git config --global mergetool.bc4.trustExitCode true

Sub module

git submodule init

git submodule update // sync the submodule to local

https://chrisjean.com/git-submodules-adding-using-removing-and-updating/
(how to upgrade submodule references)

git submodule update --init --recursive // sync the submodule to local recursively

git submodule foreach --recursive git fetch

git submodule foreach git merge origin master




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: