-
Notifications
You must be signed in to change notification settings - Fork 3
Git Memo
tenji edited this page Jan 5, 2022
·
8 revisions
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
git config http.proxy http://127.0.0.1:1080
git config https.proxy http://127.0.0.1:1080
git config --unset http.proxy
git config --unset https.proxy
git config --global http.sslVerify false
如果只需要最近一次提交,那么很简单直接使用git commit --amend
就可以搞定:
git commit --amend --author="NewAuthor <NewEmail@address.com>"
如果是多个修改,那么就需要使用到git filter-branch
这个工具来做批量修改
待补充。。。
git config --global user.name "YourName"
git config --global user.email "email@mail.com"
git config --globla commit.template [template_file_path]
git config commit.template [模板文件名]
git config commit.template
git remote set-url origin [url]
- 新建文件并保存密码
vim ~/.git-credentials
- 添加内容
https://{username}:{passwd}@github.com
- 添加 git 配置
git config --global credential.helper store
- 从原仓库 clone 一份裸版本库,比如原本托管于 GitHub,或者本地私有仓库
git clone --bare [origin-remote-git-address]
- 以镜像推送的方式提交到新服务器上
git push --mirror [target-remote-git-address]
- 先将被删除文件从暂存区恢复到工作区
git reset HEAD [file-name]
- 从工作区恢复
git checkout -- [file-name]