Git常见问题

Git常见问题

修改 commit 的注释

  • 最新的一次提交
1
git commit --amend
  • 历史提交
1
2
3
git rebase -i HEAD~3 # 如果要修改哪个,就将对应的 pick 改为 edit,保存退出
git commit --amend
git rebase --continue # 全部修改完成后提交即可

更新 .gitignore 后如何提交

1
2
3
4
5
1. 清空缓存,git rm -r --cached .
2. 重新提交
git add .
git commit -m "update .gitignore"
git push

将已经忽略的文件加入版本控制

1
git add -f D:\project\activiti-workflow\src\main\resources\static\bpmnjs\dist

第一次提交

1
2
3
4
5
git init
git add .
git commit -am 'init'
git remote add origin https://github.com/chenkaixin12121/doublemint-cloud.git
git push -u origin master

修改邮箱

1
2
git config --global user.email "chenkaixin12121@163.com"
git config --global user.email

配置代理

1
2
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080