git - fubd/blowfish GitHub Wiki
it clone -b v4.1.3 --depth 1 https://github.com/twbs/bootstrap.git
创建tag
git tag <Tag名字> (默认在HEAD上面)
git tag <Tag 名字> (指定commit打tag)
git tag -a <Tag名字> -m <注释文字>
查看tag
git ls-remote --tags (远程)
git tag (本地)
git show v1.0.0 (查看tag的diff)
推送
git push origin <Tag 名字>
git push origin --tags (推送所有)
删除
git tag -d <Tag 名字>
git push origin :refs/tags/<Tag 名字>
-
git branch <分支名>
2.git checkout <分支名>
3.git push origin <local_branch_name>:<remote_branch_name>
(远程分支不需要加origin/, 默认查看会有)
git branch --set-upstream-to=origin/phase3 phase3
参考:https://blog.csdn.net/pobaby/article/details/83507490
(保证主分支是commit后的干净的,再checkout到dev分支上merge)
git fetch origin
取远程的变更即可
git branch -vv
(此时仍然看不到新创建的本地分支)
git checkout <分支名>
本地分支已经自动创建, 且自动关联到远程分支
git branch -d <分支名>
git push origin --delete dev
查看本地分支git branch -vv
查看所有分支git branch -a
git push origin <本地分支名>:<远程分支名>
git pull origin <远程分支名>
git push origin <分支名> -f
-
git fetch --all
2.git reset --hard origin/master
3.git pull origin master
- 没有add时候, git checkout .
- 已经add、git reset HEAD . // 从暂存区恢复到工作区 不会放弃本地更改
- 已经commit, git reset --hard [git log 查看id] // 注意 这会直接恢复到上一个版本放弃本地的更改, 慎用
- 已经commit , git reset [git log id] 或者 HEAD^ // 恢复到 工作去, 可以git add重新提交
- 已经 commit , git reset --soft HEAD^ // 恢复到暂存区
先把当前本地代码全部commit,再checkout其它分支
我们不需要在A分支做commit,只需要在A分支新建B分支,然后切换过去。这个时候你会发现修改的东西在A,B分支都有。这个时候在B分支commit,那么这些修改保留在B分支上,再切换到A分支上会发现修改都没有保留下来
https://zhuanlan.zhihu.com/p/35078876 如果报错ref not match , 参考:https://stackoverflow.com/questions/4181861/message-src-refspec-master-does-not-match-any-when-pushing-commits-in-git
https://stackoverflow.com/questions/30227858/gitignore-exclude-specific-file
https://segmentfault.com/q/1010000000184974/
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
重置账号密码 git config --system --unset credential.helper