Difference between revisions of "Git"

From neil.tappsville.com
Jump to navigationJump to search
m
m
Line 19: Line 19:
 
  git pull
 
  git pull
 
  git stash pop
 
  git stash pop
 +
 +
===Merge===
 +
 +
Ensure the following are selected:
 +
* Delete source branch when merge request is accepted
 +
* Squash commits when merge request is accepted

Revision as of 22:38, 2 October 2019

Local Changes vs Repo

git log origin/master..HEAD

You can also view the diff using the same syntax

git diff origin/master..HEAD

Diff between the current branch and develop (origin of this branch hopefully) aka diff source and then current branch

git diff develop..feature/[branch_name]

If working in master (no branches used)

git diff origin/master...HEAD

Wipe all local changes and get the latest from the repo

git reset --hard        or       git checkout -- <file name>
git rebase origin/master

Or to store changes and re-apply them after pulling

git stash
git pull
git stash pop

Merge

Ensure the following are selected:

  • Delete source branch when merge request is accepted
  • Squash commits when merge request is accepted