paul
paul

Reputation: 4487

Seeing commits of another branch

I have access to repository on git but not "master" branch. I make another branch "paul_project" and when I am on this branch: I create another branch under it.

Admin@PAUL~/watirproject/AutomationProject (paul_project)
$ git checkout -b feature_one

which looks like this:

master
  paul_project
     feature_one

Similarly people like me, making another branches on top of "paul_project" as they also don't have access to "master". Which finally looks like this

master
  paul_project
     feature_one
     feature_two
     feature_three

Now problems is while raising PR (Pull request) we are seeing each other's commits too. And because of that, person who is going to review PR is having problem in reading commits, because on reading commits it looks like "feature_two" has more commits in it than it suppose to have, as it shows commits of "feature_one" also.

What is that we are doing wrong?

Upvotes: 0

Views: 171

Answers (1)

Anthony Granger
Anthony Granger

Reputation: 814

You can do a git rebase after each git pull or git fetch/git merge.

It will allow git to rewind the history and, in case of conflicts, allow you to fix them. Your branch should be clean of duplicated commits after that.

Upvotes: 1

Related Questions