1

I am new to git. And as practice, i am working on 2 braches say program_1, program_2.

git branch program_1
ls temp
git branch program_2 # (create program_2 branch)
git checkout program_2
git merge program_1 program_2 # (as i need temp folder in program_2)
# Add some files in temp folder (say 1.c, 2.c)
git add temp/1.c temp/2.c
git commit
# <some explanation reg commit>
git review

Here i am getting conflict.

You are about to submit multiple commits. This is expected if you are
submitting a commit that is dependent on one or more in-review
commits. Otherwise you should consider squashing your changes into one
commit before submitting.

The outstanding commits are:

9610151 (HEAD, program_2) program_2 submitting for review
8760f55 (program_1) Adding temp to program_1

Do you really want to submit the above commits?
Type 'yes' to confirm, other to cancel: 

So what does this means? and how to resolve this? what i am missing?

Can anyone know the answer?

Andreas Wederbrand
  • 38,065
  • 11
  • 68
  • 78
Kumari
  • 11
  • 1

1 Answers1

0

git review isn't part of standard git so it's really up to whoever developed it to answer this.

But I'll tell you as much as there is nothing weird about pushing two or more commits to gerrit for review, I do it all the time.

What will happen is that they will have dependencies between them and they will be committed in that order, no matter in what order they get reviewed.

This is the best way to handle small logical commits that are dependent on each other.

Andreas Wederbrand
  • 38,065
  • 11
  • 68
  • 78