Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
Next revision
|
Previous revision
|
systems:git_setup_and_configuration [2018/06/15 16:50] smayr [Synchronize Changes] |
systems:git_setup_and_configuration [2018/06/18 14:39] (current) smayr [Synchronize Changes] |
Therefore, instead of a ''git pull'', using ''git fetch; git reset --hard origin/master'' is a safe method to add to your workflow. It eliminates local changes, keeps you up to date with master, but ensure new changes do not get pulled in on top on current changes and make a mess. It is a safer practice. Just be sure to add/commit/stash any work-in-progress first. | Therefore, instead of a ''git pull'', using ''git fetch; git reset --hard origin/master'' is a safe method to add to your workflow. It eliminates local changes, keeps you up to date with master, but ensure new changes do not get pulled in on top on current changes and make a mess. It is a safer practice. Just be sure to add/commit/stash any work-in-progress first. |
| |
See: [[https://stackoverflow.com/questions/292357/what-is-the-difference-between-git-pull-and-git-fetch]] | See: |
| * [[https://stackoverflow.com/questions/292357/what-is-the-difference-between-git-pull-and-git-fetch|Difference between git pull and git fetch]] |
| * [[https://longair.net/blog/2009/04/16/git-fetch-and-merge/|Git: Fetch and Merge, Don't Pull]] |
| |
| Get any changes in the remote branch since the last pull: |
| $ git fetch |
| $ git diff ...origin (or $ git diff origin/master) |
=== Merge or Rebase === | === Merge or Rebase === |
Merge the ''master'' to the ''feature'' branch: | Merge the ''master'' to the ''feature'' branch: |