I forked another repo and made some changes, all on directly on the github site... I have no need to fetch a local copy (it's too big to fit onto my space-limited IDE) so I want to keep all actions done directly on the github repo page (there are unlikely to be many changes required, and if so they will be insignificant and easy to do via the github webpage).
Those changes have been merged by the owner of the other repo, so that our two repos are now synchronised. However, my fork is now showing:
This branch is 4 commits behind OtherOne:master.
How do I fix things (purely via the github page) to get things to a state where my repo is not showing as being behind theirs? If I do a Compare
in my repo it says:
There isn’t anything to compare.
OtherOne:master is up to date with all commits from MyOne:master. Try switching the base for your comparison.
So I think that the repos are in fact now fully synchronised... but I just want to remove that "behind" message (because I'm like that). Is there any way? I could just delete my repo and re-fork... but that seems inelegant.
And in future, if the other repo is updated, how do I pull those changes into mine... again... all on github and not via the CLI.
It means your copy of the remote master branch (typically denoted as origin/master) has n commits more than your local version of the master branch. You can resolve this, while you have master checked out, by typing: git merge origin/master.
This means every locally created branch is behind. Before preceding, you have to commit or stash all the changes you made on the branch behind commits. Solution: Checkout your local Master branch git checkout master.
The updates were rejected because the tip of your current branch is behind error can be fixed by pushing to a remote branch. This process is called a Git push, and it debugs the errors of the current branch, which is also known as a local branch.
Don't try it with the github site (it's possible but a bad idea). Instead use the "clean" way and do this from inside the dir with your git-repo:
Tell your repository about the original one:
git remote add upstream git://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
Get the original branches: git fetch upstream
Pull in the original data in to your branch: git pull upstream master
Push this to your github repository: git push
Update: you can now perform this action via the GitHub frontend's Fetch Upstream
button - see the Release Notes here:
You can now use the web UI to synchronize an out of date branch of a fork with its upstream branch. If there are no merge conflicts between the branches, the fork's branch is updated either by fast-forwarding or by merging from the upstream's branch. If there are conflicts, you will be prompted to open a pull request to resolve.
Old Answer:
Create a pull request that merges OtherOne:master
into your forked repo, then merge it. That should remove the message and ensure that the two repos are indeed synchronized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With