Git
Commands
Search:
| Designation 🔼 | command | Description |
|---|---|---|
| branch changeTo | git checkout [name] | |
| branch checkout | git checkout [branchName] | |
| branch checkout, create if not existing | git checkout -b [branchName] | |
| branch checkout, create new based on main | git checkout -b [branchName] main | |
| branch create | git branch [name] | |
| branch delete | git branch -d [branchName] | |
| branch merge in main | git checkout main git merge [otherBranch] | |
| branch show | git branch | |
| commit | git commit -m "commitMessage” | |
| commit Editor close | :wq ⏎ | |
| commit revert | git revert [Hashtag] | |
| directory change | cd .. | note: whitespace |
| directory change to last | cd - | |
| directory changeTo | cd /c/p/dev/java/git test | |
| directory createNew | mkdir [name] | |
| email check | git config –global user.email | |
| email set | git config –global user.email “p@m.de” | |
| file create | touch [fileName] | |
| file list | Ls | |
| file moveTo | mv [filenName] [direcoryName] | |
| file rename | mv [name] [newName] | |
| file stage all | git add . | |
| file stage single file | git add [fileName] | |
| file unstage | git rm --cached [fileName] | |
| fork Origin | cloned remote repository | |
| fork push origin | git push origin [branchName] | |
| fork Upstream | git pull upstream main | official remote repository |
| graph show | git log --graph | |
| list commit short Hashtag | git log --oneline | |
| print working directory | pwd | |
| remote check differences | git fetch | |
| remote pull | git pull --all | |
| remote push | git push origin [branchName] | |
| remote push in branch | git push -u origin [branchName] | |
| remote push locally created branch | git push --set-upstream origin [branchName] | |
| remote repository list | git remote -v | |
| repository check differences | git status | |
| repository clone | git clone [repositoryUrl] | |
| repository create | git init | |
| repository show history | git log | |
| shell clear | cls | |
| tags push to origin | git push --tags origin | |
| tags set | git tag 1.0.0 | |
| username check | git config –global user.name | |
| username set | git config –global user.name [x] | |
| version check | git -v | |
| VsCode open current directory | code . |