Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use `git stash` instead of copying files around manually to save yourself some time.


Parent comment is the quintessential example from the article that most people who know git didn't learn git properly.


Yeah git rubbed me the wrong way from the beginning and I never learned it properly. My way makes the most sense to me. Stash? where? How do I get my files back? None of that is intuitive. I understand my way.


I love git stash, but to be fair, if you've just had Git do something unexpected to your files, I can completely understand why you would not then trust Git to keep your changes safe while you use more Git commands to get back into a sane state! Sometimes simple and well understood is the best way.


Anything can do something unexpected to your files if you don't put effort to understand it. Sure, some things require less and some more effort, but using tools without understanding them, while isn't impossible, isn't exactly a recipe for good outcomes.


Now if git stash would support only stashing one specific file...


  git stash -- filename


or

    git stash push <filename>




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

Search: