【Git】常用命令

1、撤销 commit

git reset --soft HEAD^  // 撤销上一条commit 记录,依然保持代码修改

git reset --soft HEAD~n // 撤销最近的 n 条commit记录,依然保持代码修改

2、修改 commit 注释

git commit --amend

3、stash 队列操作

git stash list   // 查看

git stash clear  // 删除全部

git stash drop stash@{0}  // 删除第一个

4、git 正常显示中文

git config --global core.quotepath false

5、提交时忽略权限的变化,避免误更改文件权限

git config core.fileMode false --global

6、使下拉代码或者推送时免密

下拉了仓库之后

git config credential.helper store ;  git pull

或:

git pull   输入密码

git config --global credential.helper store

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • git常用命令总结[https://www.cnblogs.com/fanyegong/p/5127780.htm...
    G__yuan阅读 809评论 0 2
  • 1、配置全局账号密码:git config –global user.name 用户名;git config –g...
    isMe_阅读 259评论 0 0
  • 常用命令 git config --global credential.helper store #记住用户名和密...
    phpdi阅读 162评论 0 0
  • Git和其他版本控制系统如SVN的一个不同之处就是有暂存区的概念。 工作区(Working Directory) ...
    Sixah阅读 288评论 0 2
  • 初始化配置 #配置使用git仓库的人员姓名 git config --global user.name "Your...
    贱精先玍丶阅读 365评论 0 0