Skip to content

Instantly share code, notes, and snippets.

@idiottiger
Last active August 29, 2015 14:08
Show Gist options
  • Save idiottiger/bef179a55066c8fb75d2 to your computer and use it in GitHub Desktop.
Save idiottiger/bef179a55066c8fb75d2 to your computer and use it in GitHub Desktop.
git 常用命令:
---------------------------------------
1. tag:
-------------------------
git tag 列出所有tag
git tag -a [tag-name] -m [tag-description] 创建 tag
git show [tag-name] 显示该 tag 的信息
git push origin [local-tag-name] 推送本地 tag 到远程
git push origin --tags 推送本地所有 tag 到远程
2. alias 设置别名:
----------------------------
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global alias.mg 'merge --no-ff'
3. clone
---------------------------------
git clone -b <branch> <remote_repo>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment