threads / discuss / 29212

Rewriting history and public-private-ish branches

Subject: Rewriting history and public-private-ish branches

## tl;dr

2 messages between Dec 20, 2011 and Dec 21, 2011.

replies: 1people: 2as markdown or json

Jay Levitt· Dec 20, 2011, 12:33 UTC · lore

I frequently conflate git-as-version-control with git-as-deployer when I'm editing on my Mac but testing on a server. I'll do things like...

Mac: checkout -b origin/topic-branch
Mac: make a major change, commit and push
server: pull
[do while buggy]
   server: discover a typo
   Mac: fix the typo, commit and push
   server: pull
[end]
Mac: squash commits
Mac: checkout master
Mac: merge topic-branch
Mac: branch -d topic-branch
Mac: push origin :topic-branch

As long as I'm the only one who's seen this "published" history, am I doing anything bad? Do I leave any residue behind in the repo?

Jay Levitt
Peter Krefting· Dec 21, 2011, 12:58 UTC · re: Jay Levitt · lore

Re: Rewriting history and public-private-ish branches

Jay Levitt:
> As long as I'm the only one who's seen this "published" history, am I doing 
> anything bad?

I do things like that too, and as long as you know what you are doing, it usually works fine.

> Do I leave any residue behind in the repo?

As long as you run "git gc" on the repos regularly, it shouldn't really matter much. Your abandoned changes will be available through the reflog until that expires, and when that has happened "git gc" should remove them from the repositories altogether.

-- 
\\// Peter - http://www.softwolves.pp.se/

← back to recent threads