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.
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.
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.
Thank you for the tutorial!
nice video guide. keep this up. it really helps us to understand the power of IDEA
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.