-
-
Save chenxinlong/904e9f9a84567b90034e5651ceeb3483 to your computer and use it in GitHub Desktop.
git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Author
Author
git config
- line-ending 忽略:详见: https://stackoverflow.com/questions/20496084/git-status-ignore-line-endings-identical-files-windows-linux-environment
- 私有 git 库拉取协议(用前者代替后者, 例如下面就是用 ssh 而不是用 https):
git config --global url."git@gitlab.domain.com:".insteadOf "https://gitlab.domain.com/"
Author
# ssh
# ssh connection keepalive
ssh -o TCPKeepAlive=yes -o ServerAliveInterval=60 root@1.1.1.1
# gpg2
# 国内可用 keyserver
# 建议 recv 和 send key 到 sks-keyserver pool : https://sks-keyservers.net/status/
# distributing keys : https://www.gnupg.org/gph/en/manual/x457.html
keyserver.ubuntu.com
pgp.mit.edu
...
Author
gitk
安装
brew install git-gui
Author
reset
把已经 commit 的代码回退到 uncommited
git reset --soft HEAD^
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git alias
gss
正常的
git stash save不会把 untracked file 给 stash 进去,例如我们新增了一个 .go 文件,此时还没有 add 这个 .go 文件的话是无法 stash 的。如果想要 stash 这些还没有 add 的文件,就可以用
git stash save --include-untracked