Skip to content

Instantly share code, notes, and snippets.

@suziewong
Last active December 10, 2015 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suziewong/4378729 to your computer and use it in GitHub Desktop.
Save suziewong/4378729 to your computer and use it in GitHub Desktop.
git的常规操作

git clone远程分支

git clone --branch <remote_branch_name> <git_url>  
git clone <git_url> -b <remote_branch_name>   

git删除远程分支

git branch -d -r origin/social

比如我新建分支

git checkout -b test
git push origin test;

这样我的远程库就有test分支了,其他用户也可以使用test分支了。

git push origin :test

我就可以本地远程分支,远程服务器上也会因此删除分支!当分支在远程服务器上删除以后,其他user在本地执行git pull并不会将他们本地仓库的test分支删掉,这是git pull默认行为决定的。

这是德问上的一个问题 :git删除远程分支 相关的 git命令

Git tag

列出标签
git tag
打标签
git tag -a v1.0 -m 'version'
只有这样才能把tags推到Github上
git push origin master --tags 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment