But like with many professinal tools, you don't need to know everything to get to work.
I don't know all Photoshop or Ableton Live features, but I can improve my photos or create songs non the less.
With these commands you can already start your own repo and work on it locally:
git init // crate new repo
git status // show which files are changed and which of them are staged
git add -p // add "chunks" of changed files to the stage
git commit -m "<commit_msg>" // commit everything added to the stage with a commit message
git log // show a list of commits
git checkout <file> // throw away all changes since the last commit (one file)
git reset --hard // throw away all changes since the last commit (all files)
git clone <repo_url> <target_dir> // clone a remote repository locally
git pull // download and merge new commits in the remote repo that happened since the last clone/pull
git push // uploading your own changes after a commit to the remote repo
Yes, the more people are working on a project, the more commands you need, like creating a new branch and getting commits from one branch to another, or amending commits because you forgot something etc.
For a professional tool this isn't too much, I think. The 10 commands I mentioned will be remembered in less than a week. Most of the rest isn't needed often (maybe merge/rebase and branch depending on how you intend to use Git), but they shouldn't take too long either.
git checkout <file> // throw away all changes since the last commit (one file)
git reset --hard // throw away all changes since the last commit (all files)
[NOTE: these two commands actually don't do quite the same thing, which is part of the problem.]
`git reset --hard` discards the index _and_ any unindexed changes. You can think of it as essentially `git reset` (which discards the index) followed by a `git checkout .`
I think a lot of the murkiness of git's usability comes from the fact that many commands have collected convenience flags that replicate the behavior of other commands. The rest comes from the fact that `git checkout` and `git reset` can affect any or all of 1) the contents of the working directory 2) the contents of the index 3) the contents of repository metadata like branch tips and HEAD, and you pretty much just have to learn what does what.
I agree with TFA: this isn't a UI issue, it's an abstraction issue. Several of git's abstractions only make cost/benefit sense in a distributed environment. Unbundling the cost of learning dVCS abstractions would make git a better fit for the Cathedral and a worse fit for the Bazaar. This might be what you want, but you should at least be able to understand why other people do not want it.
> git checkout [--detach|-b] <commit-ish>
Set HEAD to a new place and sync the working-directory/index to it.
> git checkout <paths>
Copy paths from the index to the working directory.
> git checkout <tree-ish> <paths>
Copy paths from a given commit to the working directory.
This means that "git checkout HEAD file" is different from "git checkout file".
Similarly, `git reset` has 2 modes:
> git reset <tree-ish> <paths>
Copy paths from a given commits to the index, leaving the cwd unchanged.
> git reset [--soft | --mixed | --hard] <commit>
Set *HEAD to a new place, and optionally sync the working directory/index to it.
This is obviously terrible, but changing the names now might be worse.
I share your concerns for consistent tooling, but the idea of becoming proficient in something without putting in the effort is not reality.
Because he's the one who said that they do the same thing.
- Most people use git by learning a set of a few commands
- A minority actually understands git on a deeper level
But both groups form a mental model of how git works, and that model is apparently usually wrong, which results in those cases were you get stuck and just start with a fresh checkout and manually reapplying the changes you wanted to commit.
This book is over 500 pages, but chapters 1 to 3 will get you up and efficient within 2 hours. Especially chapter 3 (I skipped to it, I kinda knew the basic git commands from "experience"), which goes over branching and how it works. It explains how snapshots are handled and what points to what, which make working with multiple branches locally and remotely a pleasure actually.
It's honestly not to hard to get decent at git. Although I never realized how much of a tool git was until I heard about people writing 500 page long books about it.
This whole thread is evidence of two opposing viewpoints: "git is too hard" and "git is powerful, professional tool and that requires some effort".
I believe those making the latter point misunderstand the first group (to which I belong): I'm not opposed to putting in some time to learn a tool that's central to my craft.
But git seems to often be complicated not because of the complexity of the underlying problems, but because of choices made in its implementation.
Consider: If you have a decent understand of information theory, you'll be able to use any database system within a short time, even if you never had heard of SQL before. Indeed, with a few years of SQL, you'll quickly understand NoSQL systems as well – coming from Postgres, I was productive in Redis within half an hour.
But no amount of experience with VCSs will allow you dive into git without hitting a brick wall.
Most people use it like a svn with better branching and merging.
I think a lot of tutorials spend a lot of time teaching you the index/staging (a non-trivial concept that beginners don't need) but don't teach you how to survive merge conflicts and other common tricky situations which beginners are likely to run into if they're collaborating.
Your list is all you need...until you try to `git pull` and it says
> Cannot pull with rebase: You have unstaged changes.
You're only option with your list is commit your changes, but I think it's better to `git stash` then `git pull` then `git stash pop`
Though when you `git pull` you can get a merge conflict and there's two different ways to resolve it depending on if you used the `--rebase` flag or not.
Once you're done resolving those conflicts, you run `git stash pop` and could possibly get yet-another merge conflict that needs to get resolved.
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
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
Plus, now you need to use `git diff origin` rather than `git diff` to see your changes.
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.
No. Why do people think "professional" has to mean "poorly designed"?
But then, the rest of your post seems to miss the point of this thing entirely. You go on to say that you basically only need 10 commands...which is pretty much the insight that lead to Gitless in the first place.
In that sense, git is a professional tool. If you know everything about it, it doesn't get in your way. The problem is when you don't know everything about it..
The problem with git is the lack of coherence in its default UI. Multiple ways to accomplish the same task, git commands which perform incredibly different functions depending on (invisible) context, inability to decide whether commands or flags should act as the highest-level switches...
It is simply the case that, no matter how beautifully and cleanly designed git's internals might be, the interface it presents to them has zero conceptual integrity.
Visual SourceSafe springs to mind here...
Git, by comparison, is very flexible and allows you to do an awful lot, when you've learned it. You can learn SourceSafe inside out and still have it be a total pain in the arse.
Nothing in that interface is designed to aid in learning. Nothing in it is designed so that mastering one task provides discoverability or intuitability of how to perform another task. It is a complex mess of inconsistencies, discontinuities and obscurities which point more to a lack of design or even of someone with authority to perform design than to anything else. It can only be "mastered" through rote memorization, and bears no necessary or useful relationship to the underlying data models and structures whatsoever.
I have no particular view on how good or bad git's command line is - I have greatly enjoyed using SourceTree though, and the underlying DVCS seemed not to get in the way.
This idea that 'if you don't like the tool, it's because you're not good enough to use it, because you don't know everything about it' is elitist hokum.
many NTSB studies show that even master pilots with thousands of hours of training and flight time make (often fatal) mistakes due to confusion in understanding the cockpit readings
For example, the Army found that using glass cockpits doubled or quadrupled the accident rates in UH-60 and OH-58 aircraft respectively, increased it by ~30% in the AH-64, and reduced it by ~40% in the CH-47.
A five-year NTSB study found that although glass cockpits had twice the incidence rate of fatal accidents. The study concluded that glass cockpits do not show a safety benefit. This remains the position of the NTSB.
The reality is that simpler is sometimes better. Mechanical instruments each do one thing and they do it well. Vacuum-driven systems are simple and extremely reliable. You cannot fly a 100% glass cockpit, period.
What glass cockpits really do well is information integration. That makes it easier to surface relevant information for the pilot but it also means that pilots have to handle more complex systems that are throwing more information at them, and yet also may not be throwing the right information at them.
This is an inherently one-way street, the reason we have the instruments we do is because they're relevant, you can't go hiding relevant information from the pilot. As such, NASA recgonizes that glass cockpits and cockpit automation impose a higher cognitive load on pilots. It's very simple and straightforward to interact with a traditional cockpit, but with a more advanced cockpit you also need to have a correct mental model of what's happening in the background, otherwise "cognitive mismatch" will result.
Just like any other abstraction - it's nice when they work but all abstractions are "leaky" to some degree or other and you need to know how it works and be able to route around the problem to fix the cases where it fails.
The long and short here is that experience and frequent training are the key factors in aviation safety and glass cockpits actually increase the requirements in this area. They're nice when they work but they certainly are no panacea.
GUIs and "UX" are generally antithetical to making a computer do what it does best (automate things instead of creating more busywork).
I agree with you, but although CLIs are explicitly automatable, they are almost never are because most operations are one time deals. If you have evet set up a Linux server I think you'll understand what I mean. The CLI is also a usability nightmare with no discoverability.
Except for helping the 6 or so billion people in their daily lives, but hey, the iPhone would be 'better' if it just had 'bash'?
Read your email lately from bash?
Didn't think so!
Now, I use pythonista as a python-shell. Being able to chain a couple of commands and fix a good-enough solution saves a lot of time in many cases such as web scraping on-the-go.
I know this may be an extreme use case, but if iPad is going to be a laptop replacement we need to be able to get a way to speak with it without immidiate access to a laptop.
It's not a false equivalence at all.
The necessity of lower-level technology in the creation of higher-level technology does not imply that the lower-level technology is somehow 'better' or 'superior'.
You are using a UX right now to read and respond to this.
It's crazy to posit that 'UXs are inferior'. Positively wrong.
In the vast majority of cases, UX's are superior to shells. Maps, news, social media, browsing/buying things, listening to music, making music, photo editing - there are actually very few use-cases wherein the shell is advantageous. Even emacs is a UX of sorts.
GUI:s are superior for the specific (limited) use cases they are designed for, inherently since they were designed to excel at those use cases. They are however less optimal when you want to diverge from those use cases and create something new. This is where malleability/modability comes in, and where CLI:s, bash, scripting, programming comes in, and you can't use limited-scope apps for that.
All tools are best at what they were designed for, I agree with you there. I'm however not sure how I in your mind was wrong before. The two are intrinsically bound, but it's undeniable that apps can't exist without tools, but tools sure can exist without apps.
With all the security concerns and regulation regarding flight, it's easy to imagine how hard it is to move forward and innovate in usability.
I'm not saying upending git for something better would be trivial, but I don't want to constrain my imagination by thinking it's not possible.
If you can coherently explain what you need [git replacement] to do, and explain it simpler than you would explain git itself, then you have an outline of a superior tool.
They are certainly not enough to work with Git for your whole career :)
If switching to gitless became a thing I'd have to learn something new, but if it made things significantly easier for beginners, maybe my personal inconvenience isn't that important.
I always struggle with "lowering the barrier of entry" and it's not a "I did it they need too do it" it's more of a "Usually high barriers mean it's complex, and learning how to understand complex things is important."
If this was some new novel way to version that wasn't just pretty git, I'd be a lil more excited.
Now the guy was pretty technical (part of his job was AS development), but he was not a developer.
Darcs's and Git's fundamentals are not that different, but Darcs's CLI actually makes sense in and of itself independent from the implementation details, and when it diverges from the older standard (e.g. SVN) it's so that commands make more sense, not less. Meanwhile Git has taken pretty much the opposite tack.
Git's porcelain is a giant steaming roasted turd sandwich, no other DVCS has such a complex, hostile and nonsensical CLI that people tell you you're supposed to learn it from the storage model up and then it'll make sense.
Don't try to shift the buck to VCS/DVCS concepts, while they are complex Git's CLI goes a great way towards making them nonsensical to beginners and non-beginners alike. I routinely used three different DVCS before I had to take the plunge into Git, and it was still a fucking pain in the ass. And that's a problem at every level of resolutions, just compare the hot mess that is gitrevisions(7) to mercurial's (more powerful, more flexible, more readable and more regular) revsets. It's not like revsets are a genius's flash of inspiration either, "hey I'm trying to manipulate sets of revisions, how about I manipulate them as sets?" We're not talking turing award worthy discovery here.
 well they kinda are, but by and large the fundamental differences are irrelevant to basic day-to-day use.
NO IT IS NOT. <smack to back of head> That kind of thinking is broken.
Most people who have been around computers on Windows long enough eventually adopt it. They start creating zip files of directories and they put date codes on them. You laugh, but it works.
As such, it's really easy for me to explain Mercurial to them. I simply explain it that Mercurial holds those zip files with some extra information and a pretty GUI. It takes me 30 minutes, max, and they get it.
They have one branch. They occasionally share things with other people. And, very occasionally, they have to merge something--which generally gets resolved by taking this file or that file--but rarely actually merging content.
Things only start to go bad when you start adding concepts that require the user to keep state of the repository in their head. If the end user has to think about the DAG, yeah, THAT'S complicated. And that's broken.
I've now been using git and hg for so long that I know both. I now know enough about git that I have been able to unwedge my teams without just copying the repo (cue xkcd link: https://xkcd.com/1597/). I don't need to spend hours of Googling anymore, I just need quick reminders of "Oh, yeah, that stupid flag."
And, you know what, I have never, ever been in a situation where I thought "Gee, I really wish I was in git rather than Mercurial." The converse, however, happens at least once a week.
Perhaps one day my teams or my repos will be complicated enough that the light dawns. The fact that the *BSD guys still operate using CVS and Subversion makes me skeptical.
We should be celebrating better UIs over important tools, not saying "I made great effort to learn it, therefore learning it with less effort is inferior". No. If it does everything Git does, but more easily, it is strictly superior.
Meanwhile, unlike Git, I understood most of Gitless's commands before the tutorial started explaining them. Opposite experience I got with Git tutorials where I kept questioning why it would be done a certain, unintuitive way. This is definitely an improvement.
I don't think git's command line needs to be changed, though.
>If it does everything Git does, but more easily, it is strictly superior.
In the abstract I agree, but if an junior dev goes "oh, I just use gitless because it's easier" and DOESN'T understand git, it's a problem. That's my point.
I'm always suspicious of arguments like this, because they have a Luddite quality to them. Isn't sending email versus handwritten postal mail "cheating the effort" of communication?
git is a lot of effort to learn because its command line is inconsistent and it is frequently unclear what it has done, why and how to recover from it. It is worth asking if this is really necessary.
If a system has a high percentage of beginners pressing the wrong button and losing time and effort as a result, maybe someone should move the buttons?
Eclipse has stuff like workspaces with multiple projects and others have simply projects. What to do with these workspaces?
Same goes with Git. Simple VCS have central repositories and a working copy. Git has multiple repositories and every one of them can have a working copy. Other VCS don't have a stage, you simply commit your changes directly into your repository.
It's not only that these tools have different commands and stuff like Mercurial or Subversion has easier commands etc. but they really have different concepts that need to be considered while working with these tools on a daily basis.
But you don't have to internalize them on your first week or month working with them. When you got your project in the System it's mostly save and if you don't have complex workflows you can still reap the benefits of VCS with Git without knowing everything.
Or, you can use a tool that is built for purpose aka doesn't suck). I don't use a Stanley #55 Plane to trim an edge even though it can.
Mercurial, the author notes, doesn't have most of the pitfalls. Yes, everybody persists in using git because "Linus used it".
I recognize this may be a minority reason, but that is a significant one. The rest amount to being able to rebase/reorder my commits.
At no point does "linus used it" factor in. What genuine technical points about git besides "doesn't suck" are you espousing as reasons I should switch?
Note, my workplace:
a: uses git
b: is about as likely to switch to hg as a pig would be to fly
c: follows linux upstream closely (we do kernel stuff)
I know of the following things that would be reasons to move to hg, however they're more in the "nice to have" rather than "need" category.
a: evolve extension
b: more consistent ui
If I were to list out all the cons for hg from my current perspective, here would be my top 5:
a: have to unlearn fetch/pull as they are not the same between tools, which is right is academic at this point
b: have to unlearn a lot of git use over the past 8 years, not against it but I need a good carrot to bother
c: now I have to install python on some low power systems, honestly this is dumb needing to install a scripting language just to use a VCS, and I use python daily, but its extra bloat that really shouldn't be needed.
d: last I looked (~6 months ago), i'd need to install extensions to recreate most of my workflow, again, this boils down to more effort than sticking with the status quo which by and large works out of the box.
e: would be nice if hg proponents would stop with the "git users are brain damaged by bad ui" posts, it honestly just makes me roll my eyes and move on, not rethink my position, SHOW ME WHY IT IS BETTER, stop berating as that isn't helping and at best is making me think people are treating VCS choice as a religion or political affiliation, which is easily dismissed and not at all worth my time to reply.
That is a perfectly valid objective reason. It surprises me, given that I do embedded development and have yet to be in a position where Python in my toolchain is an issue, but I'm happy to concede it.
> c: follows linux upstream closely (we do kernel stuff)
Then git is your horse, full stop. Even as a Mercurial person, if I was following kernel stuff I'd use git, that's just common sense.
> e: would be nice if hg proponents would stop with the "git users are brain damaged by bad ui" posts, it honestly just makes me roll my eyes and move on, not rethink my position, SHOW ME WHY IT IS BETTER
You do realize that the UI is more than the majority of the tool, right?
People have done what you ask for. Repeatedly. Including the parent post. Git power users have written extensively of the various UI brain damage and the problems it causes for non-power users.
Git people concede the UI sucks and still persist in starting new projects with git. How should that be classified?
> If I were to list out all the cons
Do be cognizant that with the exception of objecting to python, most of your list of cons is: "I've used git and optimized for it so changing is difficult". If Microsoft/Oracle were attempting via network effects to foist such a broken tool on the open source community instead of Linus/github, people would be screaming.
Personally, I can use either now. Also, personally, I now consider Mercurial to be a not-so-secret productivity advantage (well integrated with Windows, no wedged repositories, no wasted time recovering, can explain how to use it to neophytes so executive level people and non-programmers can use it, etc.). I know that my Mercurial teams won't waste 5% of their time fighting their source code system every single week--they won't even think about their source code system.
My beef is that beginners think "Oh, everybody uses git so git is fine so let's use git". And then, once they've made that mistake, now they feel they have to defend it. And that's not cool.
Admittedly its weak but I've used it to run things like git on some really small systems. I'd rather not have to try to get python running on something like an AVR. But to each their own. Not sure what embedded development is meaning here exactly but no matter.
> You do realize that the UI is more than the majority of the tool, right?
> People have done what you ask for. Repeatedly. Including the parent post. Git power users have written extensively of the various UI brain damage and the problems it causes for non-power users.
I'm looking more for what advantage hg itself gives me, less about how much git sucks which is at this point beating a dead horse.
> Do be cognizant that with the exception of objecting to python, most of your list of cons is: "I've used git and optimized for it so changing is difficult". If Microsoft/Oracle were attempting via network effects to foist such a broken tool on the open source community instead of Linus/github, people would be screaming.
Indeed, but that just points to after 8-9 years of using git, minor gains in using hg just don't seem as warranted. To date most of what I have seen with hg hasn't shown me what I will gain from switching will be greater than moving. Perhaps thats due to not having to use hg constantly but with things like magit I really don't notice the git ui a lot unless I choose to drop into the command line.
> Also, personally, I now consider Mercurial to be a not-so-secret productivity advantage (well integrated with Windows, no wedged repositories, no wasted time recovering, can explain how to use it to neophytes so executive level people and non-programmers can use it, etc.). I know that my Mercurial teams won't waste 5% of their time fighting their source code system every single week--they won't even think about their source code system.
For my work I've no real need to integrate with windows, not sure what wedged repositories is referring to. Recovering is vague but as a worst case the reflog has always been an emergency fixer. I've not really experienced this to be honest and I'm basically the go to guy for git with my team.
> My beef is that beginners think "Oh, everybody uses git so git is fine so let's use git". And then, once they've made that mistake, now they feel they have to defend it. And that's not cool.
Thats fine, but a bit different than the original statement of Linus uses it therefore we must. It is more git is widely used, ignoring it or not knowing how to at least basically use it isn't a tenable position imo. But to each their own.
Those 10 commands are the beginning of the iceberg when you actually start using git with teams. Where are `rebase`, `merge`, `branch`, etc? These are all commands I use daily, they are complicated, and it's trivial to shoot yourself in the foot.
The problem is that you can learn those 10 commands and things will work, until they don't, and you as a beginner are now spending hours trawling StackOverflow to figure out how to, say, pull a commit from one branch to another (you might not know that such a process is called "cherry-picking").
It's telling that Torvalds said this more recently about git:
> The first Git For Dummies and Git Visual Quickstart books are going to be out in a couple of months, and that is the beginning of the end as far as I’m concerned. Those books mean the end of git expertise and github reputation as reliable indicators of geek status. Once a technology is adopted by the masses the extreme geeks find something more esoteric. Look at what happened to Ruby on Rails. The people stumbling their way through Rails to-do list tutorials have never even heard of DHH.
alias st='git status' # STatus
alias dp='git diff' # Diff Pending
alias aa='git add .' # Add All
alias di='git diff --cached' # DIff
alias cm='git commit -m' # CoMmit
alias pu='git push' # PUsh
I have a few other two-letter aliases for git as well but the ones above cover about 80% of my use I think.
For the remaining 20% I usually type the command out fully even if I have an alias for it, because those less-frequently used commands are harder to remember the aliases for, whereas the aliases that cover the 80%, I have those in my fingers now without having to think about it.
That being said, the command line interface is "meh" at best and full of byzantine options.
For what purpose? The reason for using a VCS is to get your job done. If gitless does that, why should I need to learn the concepts of a content-addressable graph storage and traversal format?
Similarly, the stash that allows you to save your uncommitted changes before switching branches is also quite worthwhile.
Those that do move, just use Git workflows as if it was Subversion.
$ gl checkout foo.py
You have uncommitted changes in foo.py that would be
overwritten by checkout. Do you wish to continue? (y/N)
NO ONE would use Photoshop or Ableton if they're were as messy as Git. Nuff said.
I think if you look deep in the guts of Clearcase for example you will see nastiness that makes git look like the ls command.
Some tools people encounter seem unintuitive and have a steep learning curve. Others that do the same thing are super easy to understand and learn. Git vs Gitless is a good example where Gitless instantly clicked with hardly a thought. That means it was a superior interface. That also means anyone telling people they need to suck it up and just accept bad interfaces that smart people were able to learn with enough wasted energy is a bad idea.
Reminds me of those guys when I first started dealing with Linux who told me I was just being slow or lazy for expecting an installer that just required a little bit of input like I had with Windows. Anyone should know everything about handling partitions, configuration of low-level graphics, init systems, whatever. These days, the installers are point-and-click for average case while including options for others. So, why did the Linux people tell me that early on? They were elitist snobs peddling bad UI's and seeing no value in good ones. That simple.
Git is bottom up. Understand the inner workings and you know what you can do. But coming from a user perspective there is a gap - first one needs to wrap ones head around the tool. Git imho. is more a framework than a tool. On Stackoverflow simple questions yield different answers all yielding results but having various trade-offs. Usability is also about orthogonality and looking from a user perspective (not an implementation perspective) Git offers often quite a number of paths getting to a certain goal.
Individuals, teams and tooling all trying to settle on certain workflows enabled by git effectively deciding to use only a subset. Particularly when it comes to teams agreeing on workflows becomes important. Git as a tool is here helpful in the sense that it enables almost everything. But for a team it takes more than agreeing on using Git. Other tools come with more comprehensive practices.
git remote add mothership ssh://firstname.lastname@example.org
git push mothership
"Decentralized" is associated with systems without a central point of failure or control.
Git qualifies as both, and Dropbox only qualifies as distributed.
Suppose we had started out with the command UI that gitless has and someone came along and tried to sell us the current git cli UI. It would be completely ridiculed.
The only thing possibly questionable about the gitless interface is that it does away with staging. However, you can always fall back to git for staging functionality if you like, and use gitless for most other commands. I think it is a win.
> Experts, who are deeply familiar with the product, have learned its many intricacies, developed complex, customized workflows, and regularly exploit its most elaborate features, are often defensive and resistant to the suggestion that the design has flaws.
Having spent dozens, even hundreds, of hours learning the intricacies of the Git command-line, it must be extremely shocking and insulting when you are told that those efforts were in vain, because the original UI was not very good and an alternative can be grokked by people of varying levels of technical competence with only a fraction of the effort you put into the original thing. I think this is what we're seeing here: people will try and defend their time investment by arguing that a professional would learn the hard thing and not lower himself to easy-to-use tools, that the new UI hides some powerful features that are rarely used, etc.
How about "sunk knowledge fallacy" or something like that?
I like to spot those, did not see this one though, but indeed, sunk cost fallacy it is. Well spotted :)
Making tools complex and painful, denying their complexity, and scoffing at the very notion of allowing a non-expert to accomplish what before required esoteric knowledge is the way the tribe of self-styled Real Programmers protects its integrity.
It can be net gain for infrequently used and rarely mastered tools. Source Control should the 2nd (after editor) most mastered tool of a developer.
Many will assume this is "dumbed down" interface and thus overall bad for source control tool.
That's only true if the power users perform a completely different group of tasks from the new users, or if the "new user" interface is made wholly incompatible with the "power user" interface.
If the power users still needs to perform the same basic tasks, the simplified and easier interface will likely make those tasks more efficient for the power user as well.
At the cost of doing things technically correct.
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?
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.)
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
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.
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.
OTOH, the alternative workflows are really not that hard, it's really not a ton of commands compared to using stash. The single most common use case I've heard so far is switching branches, and for that you can skip stash the majority of the time, many people don't seem to know that.
Your example was stash during a pull, if you do that, your workflow is:
$ git stash
$ git pull
$ git stash pop
$ git commit -am "WIP"
$ git pull
$ git reset --soft
I'm not following your alternative. Did you mean "git pull --rebase"? Because this will result in there being a WIP commit in the middle. I try to pretty much never do pulls like this, I'm in the "rebase everything to smithereens camp".
I don't want accidental merges. I do not want to have to rebase because I got a commit in the middle and it's named funny. And what I also don't want is having to deal with merge conflicts in the rebase or merge in case incoming changes don't like the changes in the WIP commit.
It's a lot cleaner to just not have the stuff in there at all, pull, and put it back on top. (like the stack that stash presents)
Yes, I am that lazy.
This is not really the way I used to do it. An example is just an example, the situations are many. Maybe I want to pull. Maybe I need to rebase my stuff. Maybe I need to switch to another branch to show something to a coworker.
I'd have to make a special branch, commit to it, and then grab the commit hash and cherry-pick that whenever I needed it. Because I would need it in all sorts of different situations. So part of the issue was keeping track of the hash. But the bigger problem was how much work I'd needed to do if I ever needed to bring those changes up to speed again. With stash, I get a merge conflict and I resolve it, and that's my new stash again, I don't even have to do anything. With a commit or cherry-pick, I have to undo it, fix it, commit it, and now manage a new hash.
I find stash easier to manage in my head specifically because it's a separate thing on the side so it doesn't get mixed up with all my other branching. It's very little headspace at this point, and mostly a decision tree in the form of:
- is the staging area empty and I want to start doing work? stash pop;
- is the staging area currently holding my stash changes and I want to do some things with git? stash.
> Because this will result in there being a WIP commit in the middle
No. Your WIP commit will always land at the end. Anything you pull will rebase to before your WIP commit.
Doing a commit+pull+reset will always work exactly as easily as stashing.
It's no less clean to commit & later reset than it is to stash & later pop. The difference is that if you commit you have a bigger safety net than if you stash.
I totally understand that stash feels easier, a lot of people agree with you. But I don't think it's true once you dig down and learn how to not use stash. And stash is more dangerous when something unexpected happens.
I was talking about the non-rebase version.
You didn't address the rest of my post: there are other cases. This will work for that particular case, but it's not a general-purpose solution.
If I have branch X with config changes, and coworker wants me to switch to branch Y but I still want my config changes, what do I do?
What if you already committed your config changes to branch X, and your coworker wants them in Y? What if you you're working along and you have commits, staged changes, unstaged changes, and you need to branch 3 commits ago instead? Stash doesn't help with either of those, and the workflow I'm advocating - just use commits and branches for temporary work - does.
Stash really only helps you if you don't like to commit often, and you spend most of your time with unstaged changes in your working tree. Nothing wrong with that, if that's how you like to work, but I think if you spend some time getting used to committing more frequently you may find it much more flexible and much safer and more forgiving than trying to keep everything straight in the working tree alone.
If you have uncommitted changes in X, and you want in Y instead, then you can:
$ git checkout Y
$ git commit -am "config changes"
$ git commit -am "config changes"
$ git checkout Y
$ git cherry-pick X
Popping a stash and cherry-picking a commit have the same process if there's a merge conflict, except that with a commit, you have undo capability if you merge incorrectly, and you have a safety net if you get lost or screw up in the middle of the resolution. With stash, you're stuck with a bad merge, and if you lose your stash -- and it happens -- you have to hunt for it by searching for dangling blobs.
You made a big deal out of having to create and remember and lookup hashes, and I don't see that as being an issue at all, and it's not a problem in my experience. You're comparing this to stash, after all, and stash only works on uncommitted changes, so there is never a case where you'll need a hash, because the stash equivalent is always at the tip of the branch, you can always use the branch name instead of a hash.
I don't use stash for cases where it doesn't make sense. I use stash for cases where, for me, it makes sense. For a special set of config changes that are never pushed. They're not part of my usual work, they're config changes. In this context, your 2nd paragraph makes no sense. I don't have to arbitrarily choose one or the other "workflow", I use both, and I simply use stash for the general case of reapplying configs on random branches. There are other ways to do it but they all require more headspace and are harder to track than stash and stash pop.
I'm not saying I need to stash or that I can't do it without stash. Have you not seen my earlier post?
It has nothing to do with being comfortable with commits. I'm already comfortable with commits. I've even said, before, that I did it with commits. It's just slower to do it with commits, and it means I have to manage commits for something I'll never, ever push. Every time I make something a commit, that's extra work for me later to make sure I don't push it out. If I make commits after that commit it's extra work for me to rebase it.
I don't put things in my stash where I care about a bad merge with them or that I'm even going to bother searching for the blob, I'll just redo the changes if that ever happens, because they're minor. They're things like: "Point to my database instead of the standard dev database". I just don't want to do them by hand every single time and I don't want to track a hash that changes every time I actually do want to change my configs.
You're the one making a big deal out of something, honestly, and you do not seem to be reading my posts very carefully because you're still making a lot of incorrect assumptions.
I'm sorry you feel like I wasn't listening to you. I was, and I read all your posts. You're absolutely right, I have made a big deal out of it. Despite the long discussion, I think we're in nearly full agreement, and FWIW, thank you for engaging.
I did misread your pull --rebase comment. I thought that was sorted now, but I'd be happy to address any other bad assumptions I'm making. It wasn't clear to me until just now that your config changes are small changes you never push. If you stated that before, I'm sorry.
Given your use case I agree with you, this is not an either-or proposition. And anyway, it's perfectly fine to leave all of this as my stupid opinion, and I don't want you to feel like you need to defend your use of stash. You clearly understand the issues and know how to use it.
In my mind, the only thing wrong with stash is how it's implemented, not its interface. I wish it had easier ways to recover, and I bet you did too that first time you used it.
Maybe the funniest part of this is I've been avoiding stash completely for years, but the threads for the last two days have convinced me there are some nice uses of stash that I may start adopting. A couple of them even increase safety! I do keep config changes around, and I like to name them with a tag or a branch, but I'm going to try stash and see if I prefer it.
> 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.
I don't know if that wasn't very clear.
Nothing wrong with opinions, there's a reason we share them, and I agree that stash could have probably been implemented a better way underneath. I have been recommended to use stash by another developer without any sort of warning, and with the implication that it's really safe and easy to use, which is rather funny in retrospect. Git's documentation page doesn't really talk about the dangers, either.
Sure, but then I also have to do:
$ git checkout -
$ git reset --hard HEAD~1
$ git checkout -
(side complaint: why doesn't "-" work for merge/cherry-pick/reset like it does for checkout?)
> why doesn't "-" work for merge/cherry-pick/reset like it does for checkout?
I don't know what a single dash does for you. On my git, I get a command line error with a single dash. Maybe you were thinking double-dash?
A double-dash is used to separate flags to your git command from path arguments, just in case a file you put on the command line starts with a dash. (Pro-tip: don't name files that start with dashes.) Running "git checkout -- ." at the top level of your repo will do the same thing as "git reset --hard HEAD".
Merge, cherry-pick and reset all work on refs, not on paths, so when you add a -- to one of those commands you may get an error like this:
fatal: Cannot do hard reset with paths
I accidentally made changes while on X when I wanted to make them on Y. I don't want to just "git checkout Y" in case that conflicts. If I do as you suggested and commit them (on X) and then cherry-pick that commit onto Y, I then have to go back to X to remove the commit I made, otherwise I have the changes on X as well.
> I don't know what a single dash does for you. On my git, I get a command line error with a single dash
"git checkout -" switches to the previous branch. Which is great, but it's frustrating that I can't do e.g. "git merge -" to merge the previous branch - logically that should be the same kind of thing.
OH, that's very nice, I want that. Guess I need to upgrade my git. Okay, that invalidates my entire previous post. Sorry! ;)
So, if you made changes on X but wanted them on Y...
The thing about the "git checkout Y" is that there's no harm in trying, and it'll work most of the time. If it does work, you only have to commit, and you're done in less time than it takes to stash & pop.
If you're just not the gambling type, here's one way to avoid branch ping-pong. I'm sure there are others.
$ git checkout -b Z
$ git commit -a "config changes"
$ git checkout Y
$ git cherry-pick Z
$ git branch -D Z
I've personally witnessed too many stash accidents. BUT, if you are comfortable with using fsck if anything goes wrong, you really have no reason to consider my opinion at all.
I'm painting a picture that is more anti-stash than I actually am. My main safety concern with stash is how it's implemented, not how easy it is. The git authors could have used something like the above commands under the hood to implement stash, but they chose to circumvent the reflog for reasons I don't know, and that choice leads to frequent accidents. Git is supposed to be your safety net, not something that gets you into trouble.
That said, a lot of people seem to think stash is many times easier than the alternative, and I think if you really look at the alternatives fairly, using commits is most of the time not more difficult than stash, and occasionally one or two extra commands. It's just not that hard to avoid stash, and there are significant benefits.
It would generate a new temp branch every time using a counter system, e.g. "stash1" "stash2", so all the temp branches effectively form a stack. The stash popping behaviour can still be supported this way (popping would cherry-pick and delete the highest numbered branch).
It would be easy enough to script as a side project too.
Unless you're wanting to take a look at the other branch clean, then you have to stash or do the extraneous commit. Most of the time I change branches to check someone else's work, or compare something that isn't working to develop/master. The stash/commit dance is a regular annoyance for me
But, your code is going to be committed & rebased later in your own branch anyway, right? If you commit some partial changes & later come back, make some more commits, and rebase/squash before pushing, you haven't done anything extra you wouldn't have done anyway.
By stashing, going away, then coming back, popping, working, committing, rebasing & pushing, you've added extra steps to the general case by involving stash, and you've added an extra failure point. If you commit instead, your changes are already there when you come back, and they stay associated with your branch while you're gone. It's harder to forget what you were doing, and it's much harder to lose your work accidentally if you commit.
I've witnessed the exact scenario you describe go bad several times when people go code review or test someone else's code, and the forget what they were doing. Sometimes people will stash again while working in someone else's branch, making it hard to keep track of which stash is which. That can lead to accidentally dropping stashes, or to popping the wrong stash.
Try only using 'git commit -am "WIP"' as a git stash replacement for a while and see if it really is any harder than stashing. To uncommit a WIP commit (which is always optional -- you could wait until you rebase -i) just 'git reset --soft HEAD^'.
Which you can later squash via interactive rebase.
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.
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.
It has extremely verbose messages (writes out a lot of stuff that you don't need to know) and common use cases often requires multiple steps (ie. add, commit, push if you just want to send a change from your work machine a github repository).
Compare this to subversion which is much less verbose, and in general just have one operation pr. use case.
A somewhat satirical example of this is Steve Losh's Git Koans.
That's not to say I don't think the underlying ideas of how Git works makes sense. I certainly think it's a lot better than RCS, CVS and SVN (never tired Mercurial).
I hated git. Every time I used it I wanted to curl up in a soft, warm, dry space... like Perforce or SVN.
Look: http://imgur.com/xY8dKWD no verbosity here and this is 99% of my git workflow. Working in a team is more tricky, but you should use and IDE with built in git support.
If you want to see a bad command line tool, try FFMPEG.
As a professional trainer, here are the most commong problems:
- git checkout does so many different things. Git check file, git checkout branch, git checkout commit all do different stuff, and don't get me started on the option flags.
- git is context dependant. If you don't know the context, espcially the state your repo is in, you will struggle. And nothing in the tool gives you enough context if you don't explicitly ask for it, which supposes you need to know you need it, and what "it" is.
- branch switching is a hard. see article.
- stashing is dangerous. I've seen many students loosing work with a stash pop requiring a merge which ended badly.
- the whole syntax is impossible to discover, even for very common tasks: git checkout HEAD^ /file/path, git rm --cached, etc.
- git assumes you know what you are doing. Which means it let you destroy history with rebase, loose stuff with stash pop, create detached head, make force push, and all it all put yourself in many situations a beginer won't understand, and above all won't need.
Now I don't blame git designers for those. They made the tool they wanted to use.
What we need is a good UI on top of that. It can solve 99% of those problems.
The github one is not so bad compared to all the ones I tried (yes I tried yours), but it's still not it. What you need is someone that look at the most done tasks and questions, and provide safe, fast buttons for that.
Yes!! Stash has a problem that it's attractive to beginners, and its easier than other commands to hose yourself. It's a separate system for managing changes outside of commits, I don't get it. They could have made shortcuts to branch & commit. Mystifying.
> What we need is a good UI on top of that.
Srsly. But, wouldn't having a consistent & clean command line interface enable that? I haven't seen a good git GUI yet, they are all crippled because they stick to git's terminology. None of the UIs have been able to escape the foundation of the git command line, and I'm starting to think it's not possible.
It isn't a separate system "outside of commits". Stashes are literal commits. If you were to write a script that made little WIP commits it would probably end up looking a lot like git-stash (which is literally just a shell script wrapper around other git commands).
I've seen this assertion before, I don't understand it. If `stash pop` has conflicts and it gets confusing, you can always just `git reset --hard` and `git stash pop` again. The stash does not disappear if there are conflicts.
The only time you can lose data is if you explicitly `git stash drop`. So don't do that. And even then, the data is sitting in the git repo and can be recovered with `git fsck`. It's really hard to lose data with git.
In my case, I temporarily changed a number of tracked "build" files that are custom my system and that I do not intend to check in for others to use. I was then asked to test a branch that someone else had checked in. My desire was to stash my local changes, check out their branch, and reapply my local changes to build it. But after "git stash pop" failed I had trouble figuring out the state of the system. I couldn't make any sense out of the messages that appeared, and fell back on Googling for answers.
My expectation was that the stash would have been popped, that I would open the build files, find some lines about merge conflicts, that I would manually fix them in an editor, and then I would rebuild. Instead, it does "something else", and hard part was figuring out what that "something else" was. There are probably excellent reasons for the exact behavior, but I'd ask: where is it made clear to the user what happens when "git stash pop" experiences conflicts? Where does it say to do what you suggest?
Separately, if you happen to know, how should I best deal with this personally frequent situation that I have a small "patch set" that I want to be able to apply to arbitrary branches, but that I have no intention of ever making visible to other users? I'm sometimes tempted to fall back on "git diff > patch.local" and manage it manually, but there must be a better way.
> git is context dependant
It's called magit.
I'm curious, how would you redesign git checkout to handle each of those different types of inputs? For me, while it appears cumbersome, understanding that a file is different from a branch and commit head seems to alleviate this problem.
The index is by far one of the best features git has in comparison to other VCS, and trying to hide it because it can be confusing to users is doing them a disservice.
EDIT: editing this to expand on why I think the index is essential:
Being able to use the VCS tool to fashion a commit separately from what is in the worktree allows you to create changesets that make sense, instead of them being "this is what happened". Exact history is not interesting, it is the logical progression of the codebase (via changes applied to it) which really matters.
Furthermore, when resolving conflicts, the index is extremely useful because you can work through a conflict (which often can span multiple files) piece-by-piece and easily tell whether you've already fixed everything, run diffs on what's resolved and what isn't, etc. I find myself missing the index whenever I need to do anything nontrivial with other VCS (which is most often Subversion)
I've seen some people argue that they don't want to commit something that has not been tested, but I don't understand this argument. Why would you test something that isn't committed? Committing (or even pushing) something does not mean the code is instantly in production, but it means you have an unambiguous way to refer to what is being tested, instead of whatever state your worktree and system happened to be in. How could you be sure you're really testing what you will be committing?
Certainly, creating separate commits after-the-fact can cause commits where the tests don't pass, but it's up to you to decide whether the merge points are what should be tested, or each individual changeset.
Let's go through that list
- git checkout does one thing: it updates your worktree to match whatever you want to check out, be that a commit, a branch (which actually is just a named commit) or a file in a branch. Why is this difficult for beginners, and how would you refactor/name the operations so that they make sense?
- I'm not sure what you mean with context-dependency. Obviously it's context-dependent in that your worktree and repository may be in a state where certain commands do different things eg. because they have the current checked out branch as an implicit parameter. I don't think it's at all different from most other VCS
- I'm not sure I'm convinced by the article's argument that branch switching is hard, but I guess I'll grant that.
- Huh. I don't use stash that often, so this is a maybe. Teach people to use stash apply instead?
- git rm --cached is weird, but mostly because git can't choose just one thing to call the index.
- You can never accidentally destroy history with a rebase. Nothing short of manually wiping files destroys history in git once something has been committed. I don't really see why detached heads would be a problem (just create a branch?) and if you force push, you're basically telling git "I know what I'm doing, shut up" in which case the tool doesn't assume you're an idiot and will do what you want. You can't call it bad UI when you explicitly have to use a --force flag to do potentially destructive things. Not being able to do it at all is worse.
Really though, other than minor gripes with terminology and maybe sometimes confusing command line switches, what is a good (hypothetical) UI for git that doesn't just ignore all the good things?
I can't disagree more. The index is entirely unnecessary, as umpty thousands of happy Mercurial users can testify.
> Being able to use the VCS tool to fashion a commit separately from what is in the worktree allows you to
... record states which never existed, and haven't been tested. It's an antipattern. If you are doing this a lot, you are doing development wrong. In the rare occasions where you do want to do it, Gitless and Mercurial, like every other source control tool, give you a way to fine-tune the set of files which go into the commit. They don't need an index to do it.
> Furthermore, when resolving conflicts, the index is extremely useful because you can work through a conflict (which often can span multiple files) piece-by-piece and easily tell whether you've already fixed everything, run diffs on what's resolved and what isn't, etc.
Again, you don't need the index for this, you need to track conflict state. As Mercurial does:
> I've seen some people argue that they don't want to commit something that has not been tested, but I don't understand this argument. Why would you test something that isn't committed?
This is a very interesting perspective! It doesn't immediately sound immensely practical, though. Say i want to test a fraction of the current working tree's state; i commit, and then ... what? Create a fresh clone of that state somewhere so that i can run tests on it?
I personally don't feel comfortable with mercurial, but that may be because I don't understand it. It's been a long time since I last touched it, but I remember thinking that the way it does branches was just needlessly complicated and cumbersome. Why does closing a branch even need to be a thing?
> you don't need the index for this, you need to track conflict state
This is what the index does. You don't need the index in mercurial, because you have something that is like the index, but not called the index.
Maybe the UI is better because "add" is called resolve, but that is really just an alias away.
> and then ... what?
Then you push it to remote somewhere and a CI system runs tests for you. Maybe you can do something productive in the meantime.
If you're just testing locally, then there's little difference, but I would still prefer testing a committed state, knowing it's safe in the repository and I can't clobber it afterwards.
I'm curious what you mean by this. What are good & bad habits wrt the index?
It makes sense the index is there for conflict resolution, and it seems really convenient for interactive adds & rebases. But I could imagine implementing those things without having an explicit staging area. Are there other more important requirements for the index? It mostly seems like a convenience that it's exposed, but not something that provides either more safety or better practice.
Many VCSs that predate git don't have an index because they don't need one, and having one wouldn't encourage better habits. Git has an index and rebasing almost entirely as a result of it's strict enforcement of lineage, which older VCSs didn't have. In Perforce you can create and manage multiple changes before you push, and you can push them in any order. Because git enforces order, it basically needs rebase and an index to make using git sane. In that sense, these things can be seen as a UI disadvantage over other VCSs. Of course we know there are much bigger advantages that come with strict lineage, so we learn to stage, rebase, etc.
What other benefits does the index provide that I'm missing?
`pop` will no longer drop the stash if there is an error applying it; it did in the past.
There is a point where it is worth having at least one person on a team study the internals of Git vs. struggling with it constantly and possibly losing work---it will save time, energy, and work in the long run.
In the stash case, `git reflog` would immediately allow you to recover the lost stash. If you're in deep shit, `git fsck` is valuable until the commits are GC'd. Even if you don't remember the commands, you'll know where to look for them, or what to search for to find it. Or even understand that it's _possible_.
> nothing in the tool gives you enough context if you don't explicitly ask for it, which supposes you need to know you need it, and what "it" is.
There are numerous PS1-augmenting scripts available; git even comes with one. But I agree that it otherwise would be incredibly frustrating for beginners.
> branch switching is a hard
I've heard many criticisms when watching others learn Git and teaching others, but this is one of the only things that never comes up once they've done it a couple times. Stash and switch. Or commit WIP and switch.
> the whole syntax is impossible to discover, even for very common tasks: git checkout HEAD^ /file/path, git rm --cached, etc.
I learned pretty much everything I know about Git from experimentation and, most importantly, the manpages. If someone is unaware of manpages, the documentation is online. Failing to read is failing to discover, yes.
> git assumes you know what you are doing. Which means it let you destroy history with rebase, loose stuff with stash pop, create detached head, make force push, and all it all put yourself in many situations a beginner won't understand, and above all won't need.
Yes, this is fair. But also essential. I have recovered from more fucked situations that I could have imagined, and have helped others do the same---situations where I would have otherwise lost work.
But it's a matter of teaching someone fallbacks. If you accidentally screw up everything with a rebase on <branch>, `git reset --hard origin/<branch>`. If you can't remember that, open tig / gitk / a web interface / etc, find the hash, and reset to it. If you are on a detached head, check out a branch. You shouldn't be force pushing, but that's nothing the manpage can't help with.
It all comes back to the basic understand that nothing is ever deleted in Git until garbage collection. There is always a hash to recover. Sometimes I just lazily scroll up in my terminal and grab it.
But your first point:
> git checkout does so many different things. Git check file, git checkout branch, git checkout commit all do different stuff, and don't get me started on the option flags
Yes, this is unfortunate.
tl;dr: Research your tools! Poke around the manpages or online. Know what you don't know so that you know where to look later. And there is always e.g. gitk to fall back on for certain things---I see others on my team do that as well.
> In the stash case, `git reflog` would immediately allow you to recover the lost stash.
Stashes don't go in the reflog, you cannot recover them with git reflog, so you're automatically in the 'deep shit' category if you lose them. Hence the statement that stashes are dangerous.
You do still have the safety net of fsck, and knowing that it's possible matters, as you point out. But, my experience with people who mess up stashes has been that fsck is so intimidating they'd rather re-create their changes. Silly, but true.
You can see them with `git reflog --all`.
But many people don't use it very deeply most of the time, and only occasionally have need to do something out of the ordinary, at which point it can be a pain to discover the Right Way to do what they need, and easy to shoot themselves in the foot.
The ffmpeg command line program is basically a demo that exposes every one of those features directly. Having it "do less" would defeat the point.
Don't like how git works? contribute. Don't make some stupid command line utility that just adds another entire layer of abstraction on top because people don't want to take an hour to read about git internals.
Git is fine the way it is, but it targets power users. Most people don't need that power.
In that sense, gitless has a proper approach even if I don't like the result.
You need a really compelling reason to layer another level of abstraction on top of git and from what I can tell, having branches be full sets of working files isn't really a good enough reason to make that switch.
Where are the improvements in Gitless exactly? Pretty telling they don't even list them in anywhere.
If you understand these, then three stages to "commit to server" won't seem too many to you. (Often you don't need the index-building stage ("add"), and then you can say "git commit -a").
What people complain about is often the CLI's inconsistency. For example "git branch -d" vs "git remote rm" to delete things. Then some things you want to do can be achieved with more than one sub-command in totally non-obvious ways. And some sub-commands do more than "one thing", like "checkout".
git co feature_branch
git fetch origin dev
git merge FETCH_HEAD
For example, I basically never want to commit and then immediately push to some server.
And for add, then commit, you can just do git commit -a.
But being able to add and commit changes separately can be very useful.
git commit -am "message".
Will add and commit. Pushing should be separate for a distributed vc.
The whole point of this tool is to add a common set of things on top of git.
I'm just saying that if your problem is that you need to enter multiple commands instead of one, then instead of new VCS you may as well just put a config file in your home dir.
You can still use all git commands.
https://news.ycombinator.com/item?id=12612333 (1 day ago, 106 comments)
By your statement, I also completely misunderstand git. That's entirely possible, but if git is so hard to understand that daily use for years doesn't lead to understanding, maybe it's ok to misunderstand git.
Well, I frequently see random things to fix while I'm working on a problem.
When I 'm ready to commit, I run `git status` and notice there's a file that's been modified that's unrelated to what I'm trying to commit.
A quick `git diff` later and I see what I did: fixed an unrelated issues. So I add that one file to the index, commit it with a relevant commit message, and then proceed to do a second commit—the one I had expected to do—also with a relevant commit message.
I do this 3-5 times a day, at least.
What if those unrelated changes are in the same file as a bunch of related changes that you've already made? Do you undo all the changes you've made in that file apart from the random bug fix and then commit, or leave them intact resulting in that bug fix commit containing changes that are unrelated to the fix?
For even more complex cases you could use "git add -i"; however, that command can be tricky to work with and I find it's usually not to helpful to get that far into the weeds.
Honestly, people for whom the command line UI is "too difficult" should just use a GUI client. That's the target audience for them.
The staging area is also known as the 'index' and the 'cache'.
(Git has a consistency-of-naming problem.)
I wonder how many git usability issues could be solved just by addressing this and this alone.
Reading the methodology used to develop gitless yesterday was interesting, but if I recall correctly, I think it left something out. They looked at how often a software design allowed users to complete their intention, but the tool ideally not only should allow users to complete their intention, but should encourage users towards practices that increase the quality of the end product. While people may struggle with staging at first, I think it in the end encourages better software, which is my biggest concern.
I consider myself an advanced git user so I am not sure I would use it myself, because my brain is hardwired to git's wicked commandline interface now. There is little that surprises me in git nowadays.
I am used to give out simple "the 10 git commands you will ever need" tutorials to people, but it's true that it is confusing for people, even with that. gitless takes out significant confusion out of the daily grind of using git, so much that I may end up recommending it instead of git itself, especialy since they are interoperable.
What I would love to see would be to have those commands percolate back into git itself. git's usability has improved significantly since it started, and while this project shows there's still a lot that can be improved, history has shown us that git can be improved. track, untrack, history, switch, resolve, publish, init's remote argument, all those could be added as commands into git and equivalent commands could be deprecated or just kept for the hardcores like me that don't want to be bothered learning a new simpler interface.
Unfortunately, given the reaction on the mailing list, I am thinking this will not/never happen and gitless will remain a friendly fork: http://marc.info/?l=git&m=147527432403442&w=2
...do we even need a "reliable indicator of geek status"?
Git couldn't really handle all the binary assets, and the artists couldn't really handle git, so it made sense. When we switched, it also took a long time before the programmers could really handle git too, fwiw.
I've long said I'd love to see something that's as nice a GUI as p4v, but with git under the hood. I haven't yet seen a git GUI that even approaches now nice p4v is, and git on the command line, once you learn it, is the best interface to git hands down.
I can't tell, but does gitless look like it could make a simpler gui to anyone else? I love the idea of gitless, I'll have to try it, but I get the sense that I'd end up needing to switch to git for some things.
It's almost as bad trying to work with MS Office file types - I wish I could get people on my team to use something else that is more VCS friendly, like HTML or Markdown, but that's an uphill battle. Even better would be if we actually used the versioning and collaboration features that are built into some of the tools like Office 365 that we pay for, but can't seem to leverage...
The alternative to file locking could be a rule set for who or which branches win when there are conflicts in binary data. Then again, as an artists you would rather know if someone's touching an asset before you dig in. With art & binary assets, it's more important than with mergeable code that your team and work is properly organized in a way that avoids multiple people touching the same file.
Not sure why GitKraken makes it so hard to add remote repositories and doesn't allow auto-push, and other niceties. But I use it for normal checkin / branch switching workflows and it's great.