0

enter image description hereenter image description heregit- current log

Using smart git, I'm trying to merge all the commits from 'admin_aps' into the origin and making a mess of it. Does 'Released_V1' act as a bridge between the two? I can't access Released_V1 from the original repository which i'm thinking in the main issue? How do I go about achieving this merge?

JPickup
  • 388
  • 3
  • 17

1 Answers1

1

I'm not seeing a mess here. In fact, I'm not seeing anything but a mainline branch followed by two merges, one which looks like a git pull. These diagrams, however, can be a little confusing until you get used to them.

Your HEAD commit, the branch tip which shows as "Released_V1" in your diagram, is a merge of origin/Released_V1. This could have come about a couple of ways, the most likely was git pull on Released_V1, with that branch set up to track origin.

HEAD~1 is the merge commit from merging admin_aps into Released_V1. Nothing odd here. The lines just indicate its merge base is farther back in history than your diagram snippet.

Then you've got your history of Released_V1 which was up to date except for "part of previous commit" and "rebased head These are all old changes after the...".

The "origin/Released_V1" text is simply showing your local commit pointer for origin's copy of Released_V1, established the last time you fetched or pulled.

In sum this looks totally normal. The history suggests you did this:

git merge admin_aps
git pull ;# could also be git fetch && git merge origin/Released_V1

What's the trouble? To push this back to your remote, you could issue (among a few options): git push origin Released_V1, which should be a fast-forward push.

Christopher
  • 42,720
  • 11
  • 81
  • 99
  • I can't switch to origin/Released_V1 from my cloned branch(the one i am trying to merge into origin/Released_V1) and i can't view any thing above "part of previous commit" on my original repository. when looking at the log of this it is just sequential commits no other branches accesible – JPickup Aug 16 '12 at 13:21
  • Yeah. You need to issue that `git push` command I list at the end of my answer. That'll put the merge on your original repository (which is presumably `origin`). – Christopher Aug 16 '12 at 13:23
  • I keep getting errors :( `Not all refs have been pushed 'Released_V1' rejected (non-fast-forward)` – JPickup Aug 16 '12 at 14:00
  • Try `git fetch && git merge origin/Released_V1`. This just suggests origin's version of `Released_V1` has advanced since you last pulled or fetched. – Christopher Aug 16 '12 at 14:09
  • am i ok to replace the remote branch? see image above – JPickup Aug 16 '12 at 14:31
  • Do you have collaborators? Looks like smart git is masking `git push --force`... it will overwrite any commits that exist on the remote that you don't have locally. It's difficult to tell you what to do without knowing your particular situation. Issue `git pull` to get origin's update. You can issue `git log Released_V1..origin/Released_V1` at the command line to see the commits in `origin` but not locally. I would strongly recommend checking out the book [Pro Git](http://git-scm.com/book). We're discussing some basic git behaviors here. – Christopher Aug 16 '12 at 14:37