Linux Opt: git - x893675/note GitHub Wiki
git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080' 
- 使用文件存储,密码为明文git config credential.helper store
- 使用内存存储git config credential.helper cache
- 对于mac os,默认开启osxkeychain存储密码
- 创建分支: git checkout -b branch_name
- 查看全部分支: git branch -av
- 合并分支: git merge --no-ff branch_name
- 删除本地分支:git branch -d branch_name
- 删除远程分支:git branch -r -d branch_name,git push origin :branch_name
- 查看代码库上流:git remote -v
- 根据commit id获取分支名:git branch --contains commit-id
- 为当前分支设置跟踪分支:git branch -u branch_name
- 
列出所有tag: git tag
- 
创建标签 - 创建轻量标签: git tag tag_name
- 创建附注标签: git tag -a tag_name
 git标签分为两种类型:轻量标签和附注标签。轻量标签是指向提交对象的引用,附注标签则是仓库中的一个独立对象。建议使用附注标签。 
- 创建轻量标签: 
- 
切换到标签: git checkout tag_name
- 
查看标签版本信息: git show tag_name
- 
删除标签: git tag -d tag_name
- 
删除远程标签: git push origin :refs/tags/tag_name
- 
发布标签 - 发布指定标签: git push origin tag_name
- 发布所有标签: git push origin --tag
 
- 发布指定标签: 
git reset --hard HEAD
git checkout .
git log --graph --pretty=oneline --abbrev-commit
git rebase -i branch/commit_id
该命令可以撤销某一次的提交并生成一次新的提交
git revert commit-id
使用git stash可以使当前修改暂存
git stash list 查看仓库所有暂存的提交
git stash pop xx 应用某个暂存的提交
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>