git:git常用指令

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_39027256/article/details/102570465

1.git branch  查看本地所在的分支

2.git branch -a  查看所有分支

3.gii branch -vv   查看当前本地分支和远程分支的关联关系

4.git branch -u origin/master  本地分支跟远程分支关联

5.git reflog  查看所有commit, 包括已经删除的commit

   执行 git reset --hard hash

    命令中最后要输的hash就是你要恢复的历史记录最前面黄色部分的hash值

    比如 git reset --hard 4458e09

 查看当前git用户名: git config user.name


 查看当前git邮箱: git config user.email


 切换git用户名: git config --global user.name "YOURUSERNAME"


 切换git邮箱: git config --global user.email "YOUREMAIL"
 

猜你喜欢

转载自blog.csdn.net/qq_39027256/article/details/102570465