Fork is a great way to start a new routine of software feature or improvement. There are situations when you would like to merge your current forked version with a latest/ongoing branch. The following code is an example of how to pull from another branch.

The ‘project directory’ is your current git project root. The second line tells git to add a remote branch  named ‘mergername’ that references to the ‘remote repository url’. The third line pulls from the remote repository and tries to merge the remote branch specified eariler with the local branch. If there are conflicts, they need to be resolved before the next commit. Once your code is fixed without merging error, you can now commit and push to the remote origin and the last line finally removes the temporaily created remote branch name.

Leave a comment