Merge upstream changes with Git

Let’s say you want to work on some code in a git repository. To do this, generally you will “fork” this repository, by cloning it into your own repository. On GitHub there’s a simple “fork” feature that takes care of this. After a while, you might have made some changes, but the original repository that was forked might also have new commits pushed to it. A question many new git users then face is: “How do I pull the upstream changes from the original repository into my own?”

Read More

WinMerge as mergetool with Git(Hub) for Windows

WinMerge is a great free tool for merging conflicts when working with a version control system like Git or Subversion. To use it with Git(Hub) follow the following steps:

  1. Locate your .gitconfig file. If you’re using GitHub for Windows, you will certainly find it in your user folder.
  2. Add the following text at the bottom of the file:

    If you’re still using a 32-bit version of Windows, Replace “Program Files (x86)” with “Program Files”.
  3. To merge a conflict, open a shell and browse to your repository’s root folder.
  4. Use the command git mergetool to merge the conflicts with WinMerge.
    If WinMerge doesn’t open, Git might still be trying to use a different tool, try again with git mergetool --tool=winmerge.

Read More