Git Code Snippets
Good Start Alias
bash
git config --global alias.co checkout
git config --global alias.cm commit
git config --global alias.pl pull
git config --global alias.ps push
git config --global alias.st status
git config --global alias.df "diff"VSCode as Commit Editor
shell
git config --global core.editor "code --wait"Remove submodule
bash
mv a/submodule a/submodule_tmp
git submodule deinit -f -- a/submodule
rm -rf .git/modules/a/submodule
git rm -f a/submoduleConfig username and email
- 目前 Autocomplete 基本上可以讓使用者找到 field name (user.name),所以這幾乎可以不用寫 😃
- 只想限定在一個 Repo 裡面可以把
--global拿掉。
bash
git config --global user.name "Name"
git config --global user.email "email@example.com"Stop replacing LF to CRLF!
Windows 應該很需要這個
bash
git config --local core.autocrlf falseUndo git add
bash
git reset <FILENAME>