Home > Enterprise >  How to combine latest commits with my uncommitted files
How to combine latest commits with my uncommitted files

Time:10-25

My manager wants me to push new changes I made so that he can review from a pull request and can merge into master. However, while I code there are some other tech guys committing to master. Manager told me that there must be only 1 commit so that in push history he doesn't see something like "Merge master into branch". I'm working on several branches and every branch has different name. How can I do that?

I tried to pull master and merge master into my branch and after tried pushing to the master again but in this case we see commit message like "Merge master into branch" and the actual commit message.

If it is duplicate please provide an URL. Thanks!

Manager wants to see something like:

- commit by: me (without merge message)
- commit by: another guy
- commit by: another guy

CodePudding user response:

So the solution seems to use rebase

Before commiting you can use:

git checkout master
git pull
git checkout your-branch
git rebase master
git commit
git push origin your-branch

and you can create a pull request later.

If you already created a pull request and want your history to be up to date with master:

git checkout master
git pull
git checkout your-branch
git rebase master
git push origin your-branch --force 
  • Related