Dumb question about git

Kevin Cox kevincox.ca at gmail.com
Thu Mar 1 07:22:33 PST 2012


When people say git encourages rewriting history.  Don't listen.  Once you
have pushed your changes to the world they are immutable.  This is because
git uses cryptography internally and changing the history messes everything
up.  If you haven't pushed you can change all of your history and it will
all be fine.  But if someone else (github) has the old hisory bad things
happen.  If you are sure nobody has pulled from github you can use --force
when pushing (I think).  It will work no matter what but you will piss off
people if they have pulled from you.  Please note that this kind of history
modifying is considered bad practice.
On Mar 1, 2012 10:10 AM, "H. S. Teoh" <hsteoh at quickfur.ath.cx> 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
> - 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".
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120301/12f8db42/attachment-0001.html>


More information about the Digitalmars-d-learn mailing list