GIT Commands
GIT Commands
/* Command to commit*/
git commit
git commit -a
git commit -m "Commit message"
git commit -am "Commit message"
/* Discard all local changes, but save them for possible re-use later */
git stash
==============================
Create branch locally
==============================
/* Command to create local branch from master branch */
git checkout -b <local_branch_name> <master_branch_name>
/* If the branch is created locally, this will create remote branch with
<local_branch_name> */
git push -u origin <local_branch_name>
git push --set-upstream origin <local_branch_name>
==============================
Delete branch
==============================
/* Command to delete a local branch */
git branch -rd <local_branch_name>
git push
==============================
Rebase
==============================
git checkout master
git pull
git pull origin --
==============================
Initial Setup
==============================
/* Commands to set the git configuration */
git config --global user.name "FirstName LastName"
git config --global user.email "[email protected]"
/* Commands to store the git configuration for future use - no need to enter the
credentials every time you push */
git config --global credential.helper 'cache --timeout 7200'
/*Edit editor*/
git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -
multiInst -notabbar -nosession -noPlugin"
git config --global --unset-all core.editor