0

I have three branches:

master dev feature 

My branch master is up to date. I want to rebase my branch feature with master

git checkout feature git rebase master 

But at the beginning I see:

First, rewinding head to replay your work on top of it... Applying: ajout model widget desc + stats Using index info to reconstruct a base tree... 

ajout model widget desc + stats is the first commit on this branch. So the rebase is using the wrong version of my branch.

The result is a lot of conflits, and my file that I have committed is gone.

Exemple :

<<<<<<< HEAD $this->createWidget('samples/footer','content', array('channeltitle'=>$channelTitle)); ======= $this->createWidget('samples/desc','desc', array('channelTitle' => $channelTitle)); $this->createWidget('samples/statistics','statistics', array('channelTitle' => $channelTitle)); $this->createWidget('samples/footer','footer'); >>>>>>> ajout model widget desc + stats 

he want to rebase the head of the branch master with the wrong commit...(ajout model widget desc + stats)

I searched for a solution to rebase my branch with the lastest commit.

| * fac92fe (HEAD, origin/feature, feature) work better | * a366488 works in AJAX ! | * f5d120e appel ajax dans la vue | * c1f8360 ajout model ajax bestVide, FeaturedChannel (no cache active) | * 211fda0 ajout widget network | * 4d1c2a5 social link | * c511472 ajout model widget desc + stats |/ | * 2f8ddcc (origin/master, origin/HEAD, master) Merge branch 'dev' | |\ |/ / | * 0c859da dev Channel/Network + fix Artifice |/ | * 41c0cfb (origin/update_channel, update_channel) update | * 66015b6 ajout bannerimg | * 1433e90 ajout entete script | * 619d850 ajout dossiet script crontab | * 8c4b2c8 channel inactive + simplification | * 37c453c modif network | * b764ddb fisrt version script update_channel |/ * 5676028 Merge branch 'generalmodels' |\ | * da10f84 Return JSON in utf8 | * 10f7897 good job bro | * 3eadddc config grunt : 
1
  • Can you please add the output of git log --oneline --graph --decorate --all please? Commented Apr 21, 2014 at 17:36

1 Answer 1

4

It doesn't actually look wrong.

Your output is expected

  1. First rewind all your commits from feature
  2. Then apply all the commits from master. This cannot fail and gives no particular output.
  3. Then apply all your commits, in order, starting with ajout...

In your case it gives conflicts. It's not unusual so you need to resolve them in the editor of your choice, then continue the rebase. In your current state the rest of the commits are still waiting to be applied, they are not missing.

  1. Fix conflicts. For all files run git add <file name>
  2. Then git rebase --continue
  3. Do this until the rebase is complete.

If it feels like havoc you can always abort the rebase with git rebase --abort

Sign up to request clarification or add additional context in comments.

7 Comments

Well if i do git rebase --continue my file on branch feature are erase and i have the new folder from master ...
Before doing --continue, what does git status tell you?
lot of file doesn't exist in my new branch. The most important is that my folder from the branch feature are gone when i want to rebase. He rebase with my fisrt commit of the branch feature, not the last
Git will rebase all of the commits, in order, starting with the first.
That is a normal conflict. Decide what you want to keep and make sure to remove all lines with <<<<<, ==== or >>>>> as they are indicators of where the conflict occurred. Git is fine with keeping them but your code will of course not run. Then run git add <file name>. Do this until all files that shows up with git status under the section "files in conflict" or similar are gone. Then git rebase --continue. It should try to apply "social link" next, possibly causing more conflicts.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.