Git使用技巧总结

Git使用技巧总结

1、Git只打印当前分支名
https://blog.csdn.net/weixin_36363813/article/details/112080220

git symbol-ref --short HEAD
git rev-parse --abbrev-ref HEAD

2、git更新本地分支信息
https://www.jianshu.com/p/83acc1211742
(1)追踪本地分支与仓库的关系:

git remote show origin


(2)将仓库中已删除的分支与本地分支的追踪关系删除掉:

git remote prune origin


(3)本地分支删除

git branch -D branchName

(4)本地仓库添加仓库新分支trace

git fetch origin featureName

3、git 生成两个commit之间的补丁

git format-patch <base commit>..<lastest commit>

4、git push部分文件

git push --prefix dist origin dev:只将dist目录提交到目标分支

5、IDEA提交失败,提示:OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
https://blog.csdn.net/weixin_42125310/article/details/106212710

原文地址:https://www.cnblogs.com/shujk/p/15063860.html