Git Command Helper

 git status - to check staged and unstaged files or to check status of the branch

git stash - to cache the local changes
git stash apply - keep the changes into the cache and reflect them into the files
git stash pop - pops the cache stack to and reflect it into the files
git stash list - displayes the stash stack
git add <file name> - specific file can be staged for commit
git add . - all the files are staged for commit
git commit -m "<commit_message>" - single line commit message
git commit - multiline commit messages
git push - to push changes on origin/remote
git pull - to get and merge origin branch changes
git fetch - to fetch changes of remote
git rebase - to move local commit at the top
git checkout -b <branch_name> - create a new branch
git checkout <branch_name> - switch between a branches
git reset --soft - revert the commit and keep the changes
git reset --hard - revert the commit without keeping the changes
git cherrypick

Commit For Single Person
1. git status
2. git add.
3. git status
4. git commit -m "<Comment>"
5. git push

Commit For Multiple Person with Branch New Creation
1. git status
2. git stash
3. git status
4. git pull
5. git checkout -b <Branch Name>
5. git stash apply
6. git status
7. git add .
8. git git status
9. If Edited Filenames are completely in Green
10. git commit -m "<Your Comment>"
11. git log
12. If you commit is in the Top
13. git push / git push --set-upstream origin <Branch Name>

Comments