git pull origin branch-name
git stash -u //if there are any working changes
git status
git checkout dev-branch
git fetch origin
git pull origin dev-branch
git checkout - (shortcut: checkout previous branch) or git checkout branch-name
git stash pop // if you did git stash earlier
git status
git merge dev-branch // before commit
git checkout bugfix-branch
git pull origin bugfix-branch
git stash -u //if there are any working changes
git status
git checkout dev
git fetch origin
git pull origin master
git checkout - or git checkout branchname
git stash pop
git status
git merge dev // before commit
git add <file-name> or git add .
git commit -m "commit-message"
Create PULL REQUEST
git commit --amend -m "new commit meesage"
git push --force origin branch-name
// need force push for squash commits
git reset --soft HEAD~1
git checkout feature/branch-name (Source Branch)
git pull origin feature/branch-name (up to date with remote branch)
git checkout qa-phase-5 (Destination Branch)
git pull origin qa-phase-5 (up to date with remote branch)
git merge feature/branch-name (merge feature branch into qa-phase-5)
git mergeTool (To resolve merge conflicts)
git add <file-name> (Stage the modified files)
git commit - m "JIRA-number: Resolve Merge Conflict Comments" (commit and add comments)
git checkout -b mergeFix/feature/branch-name (creates a new branch to track the merge conflict changes - branched out from destiantion branch)
git push origin mergeFix/feature/branch-name