Git QuickRef
gitJust a list of handy git commands
clone a repo | git clone url |
clone a repo into a folder with different name than the reop | git clone url folder |
switch branch | git checkout branchname |
pull content for current branch with rebase local changes | git pull --rebase |
remove local branches that have no longer a remote | git remote prune origin |
revert last local commit | git reset --soft HEAD~1 |
remove a directory from git | git rm -r --cached node_modules git commit -m 'rm ignored directory node_modules' git push origin master |
show reflog | git reflog (exit with "q") |
show config | git config -l |
set origin (for ssh) | git remote set-url origin git@gitlab.com:_gitlabuser_/repository |
show remotes | git remote -v |
|
|
set config values like email and username |
|
line endings
Windows uses both a carriage-return character and a linefeed character for newlines in its files (CRLF \r\n). Mac and Linux systems use only the linefeed character (LF, \n).
https://github.github.com/training-kit/downloads/github-git-cheat-sheet.pdf