0

I have a topic branch "featrue_A".

In order to test on the test machine,i push it to git server and test machine pull it down from the server then do the testing

  1. Is this a good practice?Because I don't want to git archive and cp every time I test.

  2. If I do so.How should I clean up the topic branch? I know git branch -d and git push origin :[branch_name] to delete local & remote branch.But what about the branch on the test machine? And what if many other client had pulled this branch?Because by default git pull will pull all the branch on the remote.So every guy has a empty reference.And if they in that corresponding local branch and git push,that branch will be added on the server again!!

Thanks :)

Nowhy
  • 2,894
  • 1
  • 16
  • 13
  • 1
    People can always run `git remote prune origin` ([related question](http://stackoverflow.com/questions/4040717/git-remote-prune-what-am-i-doing-wrong)) and that will prune all of their tracking branches that are no longer in origin. Seems reasonable to ask people to do that once a week or so. – Roman Dec 12 '13 at 14:57

1 Answers1

1
  1. Using Git for this sounds perfectly reasonable.
  2. Instead of pushing to refs/heads/whatever and cleaning up, I suggest you push the commits to a ref namespace that isn't included in the refspecs that are fetched by default (refs/heads/* and refs/tags/*). For example, push to refs/for-test/whatever instead. The code will be available for those who want it but won't cause clutter for anyone else. This would allow you to skip the cleanup. Saving the code used for testing can be useful in itself but as a safety feature you'll also not have to rely on users having the ability to perform non fast-forward branch updates. Think about the numbers, though. If you're going to have tens of thousands of refs I'm not sure Git will perform that well.
Magnus Bäck
  • 11,381
  • 3
  • 47
  • 59