[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gits] Git Workflow



> This sort-of-does what is wanted, but not really.  If I follow your script,
> this is the "push a file and also push its removal" technique.  This is not
> really the same as not pushing the file at all.

Yeah, I was pretty sure that following this recipe would commit the
file, and it's removal.  I don't know whether or not Dan cares about
being able to get at the "not yet ready" files and their history by
going to prior commits in the collection he wants to check in.

> (BTW, note that you have to commit the results of "git rm".)

True - forgot that.  Thanks.

> If there are files that need to be wiped out from history, you need more
> serious medicine, something like "git filter-branch".  This is tricky.  It is
> made more tricky by the fact that you'd (presumably) want to keep the histories
> of those not-yet-ready files on a separate branch so you need two runs of
> filter-branch.

I reckoned that moving commits/history around like this wouldn't be pretty.

> Depending on how the changes are staged into commits, one might also be able to
> sort things out by cherry-picking non-ready-to-push commits onto a separate
> branch.

Thought about that too, but wasn't sure if commits to the "not ready"
files were mixed with changes to files that he does want to check in.

> Another alternative: squash the changes into a single commit, then remove the
> files that aren't ready to be pushed (saving them elsewhere), then "git commit
> --amend".

That could work, though you would lose some commit history, yes?

-Kirk