Op dinsdag 4 april 2017 22:02:34 UTC+2 schreef Zero point minus two:
>
>
> - so this "editing an older commit" would give you the working tree at the 
> time of the older commit as if you were doing a time travel.
>
> - you are basically given "authority" to make changes at that earlier 
> point in time; while git remembers how to fast forward to the current 
> moment again.
>
> - so basically git rebase -i (that's the tool that does that) can put you 
> in charge of some in-between moment.
>

I must say that if you are working in a team and you are dealing with a 
shared "server" then "rewriting history" as we are doing here becomes nigh 
impossible because other people already have copies of the existing history.

So you can only really rewrite stuff if you haven't pushed this trail of 
commits to the server yet. I don't know how to deal with that if you 
actually would want to do that, but consider it impossible :p.

So you can rewrite the history of stuff you haven't pushed to the server 
all you want, but at a later date you would have to make "reversal" commits 
that undo some change, I don't know how to do that. This is the "git 
revert" command I believe. Git reverts are commits of their own, so you 
would get an on-pushing history that only goes to a later date, in that 
sense.

As long as you haven't pushed anything, you don't need to use git revert.

You can just use git rebase at that point. I don't know how you would go 
about merging stuff on a later date at a shared storage, but ideally it 
would require some cooperation where you to be the maintainer that 
"rewrites stuff" and then other people have to basically clone new copies 
again of the new shared central version. So changing anything about the 
commit history of an already shared version is a bit hard, typically you 
can only move forward in time and I guess some people would always advise 
against rewriting history, but you can do it on your own in you want as 
long as you are not doing it to a shared version.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to