Re: git loses commits on git pull --rebase with Dictator and Lieutenants Workflow
- From
Chris Packham <judge.packham@gmail.com>
- Date
- Jan 29, 2015, 17:27 UTC
- Message-ID
- <CAFOYHZDLPr1sJ2Agyq6tT=ahpgNp=eL_Q4c=-iDd9i_JqFNTcg@mail.gmail.com>
- In-Reply-To
- <loom.20150128T203924-608@post.gmane.org>
Hi,
On Thu, Jan 29, 2015 at 8:49 AM, Dick <dick@mrns.nl> wrote:
Show 43 quoted lines
> Hi all, > > I've encountered a problem with the Dictator and Lieutenants Workflow. I've > configured remote origin so it pulls from the "blessed repository" and > pushes to the "developer public" repository. > > When the "blessed repository" has the same branch name as the "developer > public" repository git pull seems to drop commits. > > I've create a test script to demonstrate, left is the blessed repository, > right.git is the developer public and right is the developer private > repository. > > rm -rf left/ right/ right.git/ > git init left > cd left/ > echo "hello world" > test.txt > git add test.txt > git commit -m . > cd .. > git clone --bare left right.git > git clone right.git/ right > cd right > git remote set-url origin ../left > git remote set-url origin --push ../right.git > echo "bye world" >> test.txt > git commit -a -m . > git push > git log > echo "start: two commits, ok" > git fetch > git rebase origin/master > git log > echo "manual fetch/rebase: two commits, still ok" > git pull --rebase > git log > echo "pull: one commits, oops?" > > Am I using git wrong or is this a git bug? > > Thanks for having a look! > > Dick
I can confirm the behaviour that Dick is seeing with git 2.0.4 (happens to be what I was running on my laptop). Just rebuilding 2.3.0-rc2 now.
AFAIK 'git fetch && git rebase origin/master' and 'git pull -r' in the scenario above should be roughly equivalent.
I'll see if I can work the testcase above into an actual test script.