Tips & Tricks

Git Questions – How to Keep a Git Fork up to Date

Carrying on our series of Git Questions, this week Gary Hockin (PhpStorm Advocate) and I look at the question: how do I make sure my GitHub fork is up to date when the open source project it forked has moved on?

GitHub’s help does, of course, cover this question. But not everyone is comfortable working from the command line, and even those who are, sometimes prefer to use the IDE if they’re already working in it.

This video shows an answer to this question which uses Git’s fetch, pull and push from within IntelliJ IDEA.

Comments below can no longer be edited.

7 Responses to Git Questions – How to Keep a Git Fork up to Date

  1. Avatar

    That80sGuy says:

    January 21, 2017

    Why was the “Update project” action (Ctrl-T) not mentioned? IMHO it’s the simplest way to get remote changes for the current branch and I use it daily. It stashes/shelves any changes if needed, fetches remote changes, rebases/merges to bring in the changes and unstashes/unshelves as needed.

    • Trisha Gee

      Trisha Gee says:

      January 23, 2017

      This works for the remote your branch is tracking. Given the example in the video, this would work to update master from the “trisha” remote, but not from the upstream mongodb remote. What we needed to do was update the current branch from a different remote, and push those changes to our own remote.

  2. Avatar

    Adelle says:

    January 21, 2017

    Thank you for the tutorial!

  3. Avatar

    Amila Kumara says:

    January 24, 2017

    nice video guide. keep this up. it really helps us to understand the power of IDEA

  4. Avatar

    Mike says:

    January 24, 2017

    If you aren’t working on an open source project where all the development is distributed just use subversion. Git is far too complicated for centralized development.

  5. Avatar

    Tennis Smith says:

    September 11, 2017

    Great tutorial. Please keep making videos like this.

  6. Avatar

    Robert Sullivan says:

    September 17, 2019

    git merge –halp!

    Thank you, Trisha, just the ticket. And I’m really liking IntelliJ, can’t believe I haven’t switched sooner.

Discover more