<div dir="ltr"><div>On 11 August 2015 at 12:23, Giles Orr <<a href="mailto:gilesorr@gmail.com">gilesorr@gmail.com</a>> wrote:<br>><br>> I'm writing a Python script that checks git repositories in the user's<br>> home folder (other folders is an option that should be added soon) and<br>> then tells you their status, both local and remote.  I want to release<br>> it publicly using github, but I'd like to maintain a private repo, and<br>> only push certain releases to github.  I admit this is mostly because<br>> I keep extensive notes in the source code and am perhaps a bit<br>> embarrassed what those notes say both about my memory and my limited<br>> coding skills.  I should probably just get over it - particularly<br>> since the code itself probably says more than the notes.  But - git is<br>> flexible enough that I imagine that this is an option: has anybody<br>> done this?<br><br>I don't think this is so much a Python matter as a question of how you deal with your work in your branches.  (And maybe I'm wrong, but I'll run through the "squash" answer quickly!)<br><br>The thing that I'll often do that is like this is to open local branches to fix bugs, and then, when preparing for release, to merge the results into the branch I want to push publicly, using the --squash option to get rid of any cruddy little commits that might seem embarrassing.<br><br><a href="http://stackoverflow.com/questions/5308816/how-to-use-git-merge-squash">http://stackoverflow.com/questions/5308816/how-to-use-git-merge-squash</a><br><br>The first example seems pretty good...<br><br>Suppose I did my work (with a bunch of dumb little commits) on the "bugfix" branch, and I want to put it into the "master" branch, voila...<br><br>git checkout master <br>git merge --squash bugfix <br>git commit<br>git push some-public-remote master<br><br></div><div>This addresses the problem of "cleaning up messy commits."<br><br></div><div>If the problem is that you want some of your python sources to get released, and others not, then you'd presumably need to have some sort of tool that rewrites the Python to remove (most? all?) comments.  Writing a "let me bowlderize the python code" tool seems likely to get real messy...<br></div><div> -- <br><div class="gmail_extra"><div class="gmail_signature">When confronted by a difficult problem, solve it by reducing it to the<br>question, "How would the Lone Ranger handle this?"<br></div>
</div></div></div>