-2

I did run these commands why is local master one ahead of remote master? and how do I resolve this problem, should I push the local to master after merging the feature branch?

git checkout origin release-branch
git add .  
git commit -m "some message"
git push origin release-branch

git checkout master
git merge release-branch
Kunal Vohra
  • 2,703
  • 2
  • 15
  • 33
m123
  • 11
  • 5

3 Answers3

0

once you push changes to branch and that got merge to master then need to get in syn with master.

git fetch && git pull will do the job for you.

If you have origin and remotes define then go for something like git pull origin master.

Kunal Vohra
  • 2,703
  • 2
  • 15
  • 33
0

You should push changes caused by merge. git push will do the job, also this answer may be helpful

dywp
  • 123
  • 2
  • 10
0

First of all, make sure that you are in the current stage of the master by pulling it to local:

git pull origin master

Then, in local its enough to checkout without mention the origin:

git checkout some-branch
// now do your coding changes in this branch, save, commit and push

Later, you should push the merged content to master as well, so:

git checkout master
git merge some-branch // now its locally merged to master
git push origin master // now its in the remote repo

To make sure and keep track of your local git repo and the remote git repo stages, use:

git log --oneline // oneline flag makes it easier to read

If you see that your working directory is BEHIND the branch you are about to work on, remember the first command of pull to make them even.

Raz Buchnik
  • 7,753
  • 14
  • 53
  • 96