Load more posts
COMPARE BRANCH Compare two branches (local) and show how much commits each branch is ahead of the other git rev-list –left-right –count <branch1>…<branch2> DIFF STATUS Get differences status…
List all remote branches # Show only remote branches names git remote # Show remote branches names with links git remote -v Update everything on local from remote…
Rename currently checked-out local branch git branch -m <new-branch-name> Rename local branch git branch -m <branch_name_to_rename> <new-branch-name> push new branch name to remote git push origin :<old_name> <new_name>…
List all local branches with names only git branch List all remote branches with names only git branch -r List all local and remote branches with names only…
Switch to some other branch first git checkout <some-other-branch-name> Delete remote branch git push origin –delete <branch_name> Delete local branch now (This command will fail, if there is…
Create a blank branch (no-switching) git branch <branch-name> Create a blank branch and switch to it git checkout -b <branch-name> Create a branch from other branch git checkout…
register modified and untracked files git add <files-to-add> Commit changes git commit -m “commit message” pull changes from origin git pull –rebase In case, merge conflict appears git…
Commit code (make sure to add files first which need to be committed) git commit -m <message> Commit code to previous commit git commit –amend E.g. git commit…
Clear stash list git stash clear Show all stashes git stash list Drop a stash Removes latest stash git stash drop Removes given stash name git stash drop…
Remove file added to staging for commit Undo git add command git checkout — <filename> Discard Changes to added file to staging git checkout <filename>; i.e. checkout repository’s…