top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

pull vs branch to branch merge in GIT?

+5 votes
318 views

I would like to run git rev-list with --no-merges to exclude the pull merge commits, but to still be able to see "regular" branch merges and their changes. Is there a way to do this or there is no way to tell between them ?

posted Feb 2, 2014 by Luv Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

No way. git pull is git fetch followed by git merge -- nothing more, it's not a distinct operation but rather something like a shortcut. Unfortunately, folks often learn git pull before (or instead) git fetch which produces wrong mental model.

answer Feb 3, 2014 by Amit Parthsarthi
Similar Questions
+1 vote

There's a challenge that i'm currently facing after migration from WINCVS to GIT. The problem here is I need to pull/fetch a specific branch (and NOT clone the entire repository) from the repository to a particular location on the AIX server.

Earlier while using WINCVS this functionality was achievable using JCVSExport package as we could just checkout a particular branch and fetch the package on to the server location.
WINCVS Command : java JCVSExport -h cvs.xyz.com -u abcde -p xxxxxx -d /abcd/cvs/testing -c "$REPOSITORY" -m "$PACKAGE"

I am not able to achieve the same functionality using GIT. I DO NOT want to clone the entire repository on the AIX server instead I just want to fetch/pull a specific branch contents on the server. Can someone please help me out with the solution or any possible way with which I can achieve the same functionality.

0 votes

I think there's a bug in git pull. Doing a git pull in a fresh repository without any commits removes files in the index.

Example:

$ mkdir foo
$ cd foo
$ git init
$ touch file1 file2
$ git add file1
$ ls
file1 file2
$ git pull https://github.com/sos4nt/empty.git master
$ ls
file2

"file2" is still there, but "file1" was silently removed and no error message was shown.

I'm running git 1.8.3.1

...