场景一
1
2
| go env -w GONOPROXY=私有仓地址
go env -w GOPRIVATE=私有仓地址
|
1
| git config --global url."git@私有仓地址:".insteadOf "https://私有仓地址/"
|
场景二
1
| git rebase -i {本次开发,自己第一次提交的前一次commit-id}
|
将除了第一行之外的所有 pick
改为 f
, 保存退出
1
2
| git rebase --continue
git push -f
|
只能基于master分支,在自己本次的开发分支使用
只能合并日志,美化 git log
输出,每次提交还是能看到的
ps:更换编辑器命令 sudo update-alternatives --config editor
换行符警告
1
2
3
4
5
6
7
8
9
10
| $ git commit -am "XXXXXX。"
warning: LF will be replaced by CRLF in XXXXXX.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in XXXXXX.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in XXXXXX.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in XXXXXX.
The file will have its original line endings in your working directory
……
|
1
2
| $ git config --global core.autocrlf false
$ git config --global core.safecrlf false
|
再写一些基础操作吧
获取别人刚才推的远程分支,需要先
从master检出一个开发分支
1
| git checkout -b some-dev origin/master
|
开发之后,发现分支选错了
1
2
3
| git stash
git chekout {对的分支}
git stash pop # 或者 git stash apply
|
1
| git reset {该次提交的前一次commit-id} # 注意不要加上参数 --hard
|
1
2
| git update-index --chmod=+x script.sh
# git update-index --chmod=+x *.sh
|
1
2
3
4
| # 本地保留文件
git rm --cached test.txt
# 删除本地文件
git rm --f test.txt
|