Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix this in git "This branch is out-of-date with the base branch"?

Tags:

I am working on a project and I made a PR to the project in github and now my PR says that

"This branch is out-of-date with the base branch , Merge the latest changes from master into this branch"

So which git command should I use in order to make my branch parallel to the master branch?

like image 876
S.m.g. baquer Avatar asked Dec 10 '18 20:12

S.m.g. baquer


People also ask

How do I fix branch out of date with base branch?

Update your pull request branch by rebasing When your pull request's branch is out of date with the base branch, you now have the option to update it by rebasing on the latest version of the base branch.

Why does git say my master branch is already up to date even though it is not?

The message “Already up-to-date” means that all the changes from the branch you're trying to merge have already been merged to the branch you're currently on. More specifically it means that the branch you're trying to merge is a parent of your current branch.


1 Answers

If you created the Pull Request from a branch in the same project repository, then:

  • make sure you've checked out your branch (the one from the PR): git checkout your-branch
  • with your branch checked out, you should do a git pull origin master
  • then git push origin your-branch to update the PR.

If you forked a repo, created a branch and submit the PR, follow these steps:

  • create a remote with the original project repo: git remote add upstream 'url.git.here'
  • make sure you've checked out your branch: git checkout your-branch
  • get the latest changes from the upstream to your-branch: git pull upstream master
  • after that, push the changes you've got from upstream: git push origin your-branch
  • finally, you can go to github page to make sure no more out-of-date is blocking your PR.

After that, you should see that your PR is all good to be merge (after reviews is set).

Let me know if it helps.

like image 72
Carlos Parra Avatar answered Sep 18 '22 17:09

Carlos Parra