Hacker News new | past | comments | ask | show | jobs | submit login

Perhaps I'm missing something, but in years of development using git as our scm, I have never used checkout -f. I've used reset --hard HEAD here and there. Is there any difference in their use?

Also, are there a lot of developers who work for hours without committing? I've only found myself in a situation where I could possibly lose hours of work a few times and each time this happens I realize I was treading thin ice.

Lastly, and maybe this is also just me, I keep my repos in Dropbox. Github is our main repo store, but I've got an extra level of protection, especially since Dropbox allows you to rollback file changes.




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.


It's funny -- I think this is where some of the conflict lies. With git, you can do a bunch of commits with crappy comments and then, when you are ready to publicize it (push, whatever), you can use rebase to pretty up your commit history. In other words, I take the analogy of "crappy commits" to "crappy code" a step further: the commit history is another document that is to be presented to other developers; make it helpful!


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.


as davvid says, the git project is an excellent place to start. The git project inherited a lot of its practices from the linux kernel project, but they are different enough to make looking at both interesting.

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...


The git project itself is a perfect example, and the code reviews on the mailing list will often note changes that should be made to commit messages.


> Also, are there a lot of developers who work for hours without committing?

I manage maybe an hour at a max, and then have to make extensive use of commit -p to tease apart all the changes I've made.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: