www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Dumb question about git

reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
OK, so I'm new to git, and I ran into this problem:

- I forked druntime on github and made some changes in a branch
- Pushed the changes to the fork
- Pulled upstream commits to master
- Merged master with branch
- Ran git rebase master, so that my changes appear on top of the latest
  upstream master.
- Tried to push branch to my fork, but now it complains that I have
  non-fast-forward changes and rejects the push.

What's the right thing to do here? Looks like I screwed up my branch
history. How do I fix it?

Thanks!


T

-- 
Real Programmers use "cat > a.out".
Mar 01 2012
next sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 01.03.2012 19:11, H. S. Teoh wrote:
 OK, so I'm new to git, and I ran into this problem:

 - I forked druntime on github and made some changes in a branch
 - Pushed the changes to the fork
I use the magic pull --rebase <how-ever-you-call-dlang> master instead of these 3 if I have changes but want to sync with upstream.
 - Pulled upstream commits to master
 - Merged master with branch
 - Ran git rebase master, so that my changes appear on top of the latest
    upstream master.
That's pretty much all.
 - Tried to push branch to my fork, but now it complains that I have
    non-fast-forward changes and rejects the push.
I think push --force should do the trick
 What's the right thing to do here? Looks like I screwed up my branch
 history. How do I fix it?

 Thanks!


 T
-- Dmitry Olshansky
Mar 01 2012
prev sibling parent "Daniel Murphy" <yebblies nospamgmail.com> writes:
Unless you have an expectation that other people are already using the old 
version of your branch, just use 'git push blah -f' to overwrite the old 
version.  It's not a big deal for patches and pull requests, but it would be 
a disaster if anyone did this to the master branch.

"H. S. Teoh" <hsteoh quickfur.ath.cx> wrote in message 
news:mailman.271.1330614611.24984.digitalmars-d-learn puremagic.com...
 OK, so I'm new to git, and I ran into this problem:

 - I forked druntime on github and made some changes in a branch
 - Pushed the changes to the fork
 - Pulled upstream commits to master
 - Merged master with branch
 - Ran git rebase master, so that my changes appear on top of the latest
  upstream master.
 - Tried to push branch to my fork, but now it complains that I have
  non-fast-forward changes and rejects the push.

 What's the right thing to do here? Looks like I screwed up my branch
 history. How do I fix it?

 Thanks!


 T

 -- 
 Real Programmers use "cat > a.out". 
Mar 01 2012