0

I am a GIT newbies, while trying to do a merge I found that some of my commits are missing. I got the below findings

Some of the commits of the branch "ACCOUNT_RECORD_TO_DB" is missing with the first command. While the second command shows the complete history of commits. Could someone tell me the differences between "ACCOUNT_RECORD_TO_DB" and "origin/ACCOUNT_RECORD_TO_DB"?

Thanks in advance

git log ACCOUNT_RECORD_TO_DB --pretty=oneline

git log origin/ACCOUNT_RECORD_TO_DB --pretty=oneline
Lewis Wong
  • 269
  • 1
  • 3
  • 17

2 Answers2

2

Origin is remote branch pointer, In git if you are sharing branch among team, than you have to put it at some where remotely.

So origin/ACCOUNT_RECORD_TO_DB is a your remote branch while just ACCOUNT_RECORD_TO_DB is your local branch.

if your run : git merge ACCOUNT_RECORD_TO_DB some_other_branch. it will update only local branch not remote pointer.

git log origin/ACCOUNT_RECORD_TO_DB --pretty=oneline this will show log of remote branch that last faced in local, merge will not update it.

git log ACCOUNT_RECORD_TO_DB --pretty=oneline this will show log of local branch after merge.

Piyush Aghera
  • 965
  • 7
  • 13
0

Says, the ACCOUNT_RECORD_TO_DB branch was branched out from commit C1

C1 -> C2 -> C3 -> C4 <== master
|
B1 -> B2 -> B3 <== ACCOUNT_RECORD_TO_DB

Now my understanding is below commands only merges the changes from B1 to C4

git checkout master
git merge ACCOUNT_RECORD_TO_DB

To merging in changes from B3 to C4, below command should be used instead.

git merge origin/ACCOUNT_RECORD_TO_DB

Am I right?

Lewis Wong
  • 269
  • 1
  • 3
  • 17