3 ms·
Swiping that first one - I have hundreds of commits which were just one or two character tweaks after I had hit the commit button. Often, they squash bugs. (H
by patio11 16y ago
Swiping that first one - I have hundreds of commits which were just one or two character tweaks after I had hit the commit button. Often, they squash bugs. (Hah, test run completed and now I realize the error of my ways...)
More articles like this, please?
- deleted 16y ago[deleted]
- hayeah 16y agoGlad you like it. Another weird thing I do is that "g" is not just an alias, it's a function in my ~/.bashrc So "g" (without any argument) is "g status", with arguments, g is effectively an alias for git. A micro-optimization, true. Another git feature I use quite a bit is the history rewrite. "git fuss 5" allows me to fiddle with the last 5 commits. I should write another article to explain git fuss. History rewrite sounds like a dirty thing. But my git workflow involves doing a whole bunch of temporary commits, so I can track small incremental steps with git. History rewrite is pretty legit for this usage pattern. g() { if [[ $# == '0' ]]; then git status else case $1 in fuss) shift git rebase -i HEAD~"$1";; *) git "$@";; esac fi }
- dustingetz 16y ago> History rewrite sounds like a dirty thing well you're only rewriting local history, so you're a-ok. history re-writing becomes a dirty word when you re-write history that someone else may have already seen. i know you already know this.
- cpeterso 16y ago> history re-writing becomes a dirty word when you re-write history that someone else may have already seen. It seems like git (or some friendlier wrapper) could track this for you. For example, if you've pushed changes to a remote repo, then git could mark those changes as "published" in your local repo and warn you when you later try to rewrite that branch's history.
- zb 16y agoYou should try out Stacked Git, it provides a very easy way to deal with temporary commits. http://www.procode.org/stgit/ http://www.procode.org/stgit/