A safer git checkout
cirw.in
A safer git checkout
1–10 of 20 posts
Re: A safer git checkout
#2Re: A safer git checkout
#3Re: A safer git checkout
#4Also, 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.
Re: A safer git checkout
#5Perhaps 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 ic…
Re: A safer git checkout
#6Perhaps 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 ic…
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.
Re: A safer git checkout
#7Perhaps 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 ic…
I've worked with developers that went days without committing... it was maddening.
Re: A safer git checkout
#8Re: A safer git checkout
#9Re: A safer git checkout
#10Even 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 orphaned for a while (a week or two?) will Git truly discard them.