7 ms·
Very cool. The idea which I liked most, is the ability to switch between branches, even though you still have uncommitted changes. With git, I'm forced to eithe
by whack 10y ago
Very cool. The idea which I liked most, is the ability to switch between branches, even though you still have uncommitted changes. With git, I'm forced to either make an extraneous commit, just to enable branch switching, or stash all my changes into a stack which I may later forget all about. Both of the solutions above are really cumbersome and prevent easy context switching.
The only feature I noticed missing, is the ability to stash changes. I use this most often to move changes from one branch to another branch, without cluttering history with an extraneous commit. How would this work on gitless?
- m3kw9 10y agoJust use the normal git fallback command
- iagooar 10y ago> Both of the solutions above are really cumbersome and prevent easy context switching. Too frequent context switching might actually be perjudicial for your productivity and health, while increasing stress levels. So git not making it trivial might not be a bad thing, in my opinion.
- wreft 10y agoI don't think perjudicial is a word.
- leshow 10y agoyou are wrong
- twic 10y agoIt seems to be a word in Spanish. It isn't a word in English.
- leshow 10y agoprejudicial is absolutely a word in English. look it up
- TuringTest 10y agoBut "perjudicial" is a word in Spanish, meaning "harmful", "detrimental". I think that was the meaning intended.
- wreft 10y agoThank you.
- nicky0 10y agoJust a misspelling of prejudicial
- billsix 10y ago> I'm forced to either make an extraneous commit, just to enable branch switching Which you can later squash via interactive rebase.
- dahart 10y ago> With git, I'm forced to either make an extraneous commit... You only need to commit or stash if there are conflicts, and many time there aren't, so you can first try to switch branches without stashing. > The only feature I noticed missing, is the ability to stash changes. I use this most often to move changes from one branch to another branch I started a big ol thread on stash yesterday, but there are a bunch of safer alternatives to stash. You never have to clutter history, you can always move things around and still keep it clean. Problem with stash is it circumvents git's normal systems, so it's a little dangerous (which the stash man page mentions.) https://news.ycombinator.com/item?id=12612630 https://news.ycombinator.com/item?id=12612630 If there are conflicts, you could do this instead: $ git checkout -b work $ git commit -am "WIP" $ git checkout another_branch $ git cherry-pick work $ git branch -D work Exact same effect as stash with no clutter left over in the history, and much safer. The advantage here is your changes are put multiple places and referenced by git, so if anything ever goes wrong it's in the recent reflog. With stash, if you have problems, your only option is to use fsck. Given that the whole point of gitless is to avoid super confusing and intimidating commands like fsck, especially for beginners, it makes sense to me they chose not to include stash.
- projektir 10y agoThe whole advantage of stash, the way I see it, is that you don't need to type out a whole bunch of commands to stick something into another branch and deal with remembering where you put it and what you called it and so on. I started out using secondary branches since that was the intuitive way of doing things, and I had issues with stash before, but after a while I went back to using stash again because it's just so much faster to stash my config differences, do all the necessary merges or pulls or switches, and then just stash pop. A large part of the advantage is that stash is a bit orthogonal to the usual workflow, so it goes in a specially defined place in my brain vs being yet another branch, especially if I already have work/dev/backup branches for other purposes. I agree that I wouldn't recommend using the stash to beginners, though, it does really odd things at times if you are not clean with it. First time I used stash, I lost all my code and nobody could figure out how to get it back. :P But that the thing - I never stash crucial code, just things like settings that are special to me and not other developers, so they'll probably never be pushed.
- arielb1 10y agogitless gives each branch its own separate worktree (see `git worktree`), and saves/restores them when you switch branches. Also, there's no harm in creating "temp" commits. If you are having multiple branches, you probably want to give your current state a name - which is what a "temp" commit is.