Earlier quoted context omitted.
I've worked with developers that went days without committing... it was maddening.
Can we all work on this? Somehow nobody seems to treat writing crappy commits (messages like "work since Tuesday" or "it works now") like they would writing crappy code. Version control is fundamental to our job .
A safer git checkout
11–20 of 20 posts
Re: A safer git checkout
#12Earlier quoted context omitted.
I've worked with developers that went days without committing... it was maddening.
Can we all work on this? Somehow nobody seems to treat writing crappy commits (messages like "work since Tuesday" or "it works now") like they would writing crappy code. Version control is fundamental to our job .
Re: A safer git checkout
#13I've been using Git for a couple years now, and I don't think I've ever lost any work. Even if you do `git reset --hard HEAD~5`, "throwing away" your last few commits, they aren't actually discarded yet. You can do `git reflog` to see them and then `git checkout -b some_commit_hash` to recover one to a branch, or `git reset --hard some_commit-hash` to set this branch back to that point. Only if those commits stay orp…
Re: A safer git checkout
#14I don't see how git-cof is different/better than git-stash.
The most obvious difference is that commits made with git-cof never show up in git log --oneline --graph; but also they get garbage collected automatically, you don't have to manually go through "git stash list".
Re: A safer git checkout
#15Dear author: the plural of alias is aliases.
Re: A safer git checkout
#16Earlier quoted context omitted.
Can we all work on this? Somehow nobody seems to treat writing crappy commits (messages like "work since Tuesday" or "it works now") like they would writing crappy code. Version control is fundamental to our job .
Most developers learn by example. I've looked for resources on using vcs properly but the few that existed weren't very good. A great resource would be a showcase for a collection of great commits. It doesn't exist as far as I know unfortunately.
Re: A safer git checkout
#17I've been using Git for a couple years now, and I don't think I've ever lost any work. Even if you do `git reset --hard HEAD~5`, "throwing away" your last few commits, they aren't actually discarded yet. You can do `git reflog` to see them and then `git checkout -b some_commit_hash` to recover one to a branch, or `git reset --hard some_commit-hash` to set this branch back to that point. Only if those commits stay orp…
It becomes dangerous if you have changes in your working tree. You truly lose those changes with a "git reset --hard HEAD" or the forced checkout.
Re: A safer git checkout
#18Dear author: the plural of alias is aliases.
I know :). See https://github.com/ConradIrwin/git-aliae#faq .
Re: A safer git checkout
#19Earlier quoted context omitted.
Can we all work on this? Somehow nobody seems to treat writing crappy commits (messages like "work since Tuesday" or "it works now") like they would writing crappy code. Version control is fundamental to our job .
Most developers learn by example. I've looked for resources on using vcs properly but the few that existed weren't very good. A great resource would be a showcase for a collection of great commits. It doesn't exist as far as I know unfortunately.
The archive for the git list is at [1].
The other great thing to look for is a well designed standard, with examples, for how a commit message should look. Most everyone who uses a standard uses The Standard* [2], so I would suggest you do the same.
* Except that many projects don't require the sign-off
[1] http://dir.gmane.org/gmane.comp.version-control.git
[2] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messa... (I am pretty sure there is a very similar post from Linus on a mailing list somewhere, but I can't find it. This is the most commonly linked to that I could find.)
[EDIT] formatting...
Re: A safer git checkout
#20I've been using Git for a couple years now, and I don't think I've ever lost any work. Even if you do `git reset --hard HEAD~5`, "throwing away" your last few commits, they aren't actually discarded yet. You can do `git reflog` to see them and then `git checkout -b some_commit_hash` to recover one to a branch, or `git reset --hard some_commit-hash` to set this branch back to that point. Only if those commits stay orp…
It becomes dangerous if you have changes in your working tree. You truly lose those changes with a "git reset --hard HEAD" or the forced checkout.