News for hackers. Stuff that matters.
Re:Gitless: a version control system by dahart on Monday October 03, 2016 @12:43PM (#12628999)
> Basically, I'd add `git stash` to your collaborative list. You can't `git pull` without it.

Of course you can! Git stash is not necessary for any workflow, it's pure convenience.

Best practice is not to pull with unstaged changes. If you want to, then:

  $ git commit -am "WIP"
  $ git pull --rebase
Easier than stashing! But this does mean you're going to need to rebase -i later before you push.

Stash is dangerous for beginners, I don't recommend learning it first. From the stash man page:

"If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms." https://git-scm.com/docs/git-stash

Re:Gitless: a version control system by collinmanderson on Monday October 03, 2016 @01:00PM (#12629173)
Sure, but my guess is it's just as easy to shoot yourself in the foot with rebase -i. Beginners are still going to have a hard time recovering mistakes with rebase -i, even if it's theoretically possible to recover.

Plus, now you need to use `git diff origin` rather than `git diff` to see your changes.

Re:Gitless: a version control system by dahart on Monday October 03, 2016 @01:14PM (#12629313)
> Sure, but my guess is it's just as easy to shoot yourself in the foot with rebase -i.

No. rebase -i goes in the reflog. stashes don't. The rebase man page does not have the same safety warning that the stash man page does. I have personally witnessed a lot of stash accidents, and not many rebase accidents.

With a rebase, if you have a bad merge conflict, you can abort. With a stash you can't. If you've committed your changes and have problems either forgetting what you're doing, or with merge conflicts, or with being in the wrong branch. All of these cases have more undo options with commits. In the worst case, you still have the safety net of the reflog with commit. With stashes, your only safety net is hunting for dangling blobs using fsck.

Previous threads: https://news.ycombinator.com/item?id=12613062 https://news.ycombinator.com/item?id=12622414

Re:Gitless: a version control system by collinmanderson on Tuesday October 04, 2016 @09:05AM (#12635187)
I mean it's just as easy to make a mistake in the first place with rebase -i. Even though one is theoretically possible to recover with rebase -i, it's going to be very hard to recover for a beginner. (You need to know the reflog command, etc.)