git相关的操做

给你们分享下git的使用心得,有不足的请你们补充:git

克隆:git clone https://XXXXX服务器

克隆指定分支:git clone -b https://XXXXspa

 

添加全部:git add .(注意add后面有个点同步

添加指定:git add XXXit

 

上传本地:git commit -m “XXX”分享

推送服务器:git push -u origin "branch-name"推送

 

拉取更新:Git pull origin “branch-name”di

本地与远程分支同步:git pullco

 

合并:git merge “branch-name”(想把A分支合并到B分支,须要切换到B分支,而后执行git merge A)远程

 

切换分支:git checkout “branch-name”

建立分支:Git branch “branch-name”

建立并切换分支:git checkout -b “branch-name”

 

拉取查看更改:git diff HEAD^

查看本地修改:git diff

查看分支:Git branch

查看远程分支:git branch -r

查看分支状态:git status

 

删除分支:git branch -d “branch-name”

删除远程分支:git branch -r -d “branch-name”

 

取消修改:git checkout .(注意checkout后面有个点

相关文章
相关标签/搜索