Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you go down this “autocommit” road, always be sure to keep such history local. As <a href="https://stackoverflow.com/users/148761/russell-steen">Russell Steen</a> commented, automatic checkpoints are not something that belongs in any kind of published, advertised branch. It is fine to keep for local reference, but otherwise it is just an ungroomed mess unfit for publication.</p> <p>It is not too hard to write a <a href="http://github.com/indirect/xcode-git-build-scripts/blob/master/autocommit-build.sh" rel="nofollow noreferrer">simple script that will ‘autocommit’ to an specified branch</a>. The linked script is not one that I use, just one that I found. It is a bit ugly in that it forcibly changes branches, so you would have to make sure it does not run if you are doing stuff manually. Also, it uses ‘porcelain’ Git commands instead of sticking to the lower-level (but correspondingly, more interface-stable) ‘plumbing’ commands.</p> <p>You might also be interested enough to review a <a href="http://thread.gmane.org/gmane.comp.version-control.git/139691" rel="nofollow noreferrer">recent thread on the Git mailing list</a> that covered some of this ground.</p> <p>In particular, it references <a href="http://gist.github.com/303142" rel="nofollow noreferrer">another script</a> that does not “steal the current branch” and does a better job of using plumbing commands (but inexplicably, still uses <code>git add</code> instead of <code>git ls-files</code> and <code>git update-index</code>).</p> <p>All in all, writing a script to do what you want is not terribly difficult. Doing it right (using plumbing, not stomping on the active branch (which is easy when you using plumbing), etc.) is a bit more effort, but worth it for the bits of Git that you will learn along the way.</p> <p>You could even use <a href="http://git.kernel.org/?p=git/git.git;a=blob;f=contrib/examples/git-checkout.sh" rel="nofollow noreferrer">the old shell implementation of <code>git-commit</code></a> as a starting point (and a good example of the plumbing and how to use it).</p> <p>To get a checkpoint on a regular basis, just a stick script like ones of these it in a <em>crontab</em>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload