4 ms·
Git is hard because it precisely models the complexities of concurrently modifying source code on multiple computers. It explicitly models all of the concepts a
by m12k 6y ago
Git is hard because it precisely models the complexities of concurrently modifying source code on multiple computers. It explicitly models all of the concepts and operations that are relevant in that domain - branching, merging, my local changes, the server that my local branch is kept in sync with, rewriting local history, rewriting public history. Can you shoot yourself in the foot? Absolutely, because this stuff really is non-trivial. Could it be made easier? Yes, by limiting what operations you're even allowed to make, and streamlining those (c.f. git flow).
- jonathanstrange 6y agoIt would be great to have a GUI tool that allows you to do common tasks with a sort of Wizard interface with validation, precise human-understandable explanations, delayed execution (like GParted) and Undo functions. Personally, I don't use GUI tools for Git because they are either as complex as the command line version or I'm afraid they do something under the hood that is not what I intended. I'm not sure GUI tools for Git are programmed in a way that makes data loss impossible. Some kind of troubleshooter GUI tool that covers 90% of all use cases would be great. I'd certainly be willing to pay for it.
- gitowiec 6y agoExactly what I feel about this tool. I don't get it what is the structure of the inner tree of git changes. Once I though I understand those graphical graphs where branches go out of other branches and than after some commits are merged back. But then I learnt something more and I lost confidence in what I believed before.
- sktguha 6y agoyes agreed. very well said.
- lmm 6y agoWhy can't there be an equivalent of stash that keeps track of which parts were added and which weren't? If switching branches wouldn't conflict with my current change, why do I have to stash/checkout/unstash instead of just doing it? Why can't I pull without fetching? Why will none of the 5 or so push configurations just do "push the current branch to the branch of the same name on the remote"? Why is there no way to stop git from setting master as the upstream every time I do git checkout -b myfeature origin/master? Why do I have to detach from a branch before deleting it? None of this stuff is inherent to the problem or due to being a precise model of things; quite the opposite.
- acdha 6y ago> Why can't there be an equivalent of stash that keeps track of which parts were added and which weren't? What do you mean by this? It sounds like how stash already works. > If switching branches wouldn't conflict with my current change, why do I have to stash/checkout/unstash instead of just doing it? This is how git has worked for years: you can checkout a non-conflicting branch without stashing. > Why can't I pull without fetching? Have you customized Git to not support this? > Why do I have to detach from a branch before deleting it? When does it make sense to do this? I can understand deleting a remote branch (which doesn’t require this) but deleting the current local branch doesn’t seem to make sense in any normal workflow.
- lmm 6y ago> What do you mean by this? It sounds like how stash already works. I want to switch branches when I have some added (staged) changes and some unstaged changes, and keep the same set of staged and unstaged changes afterwards. > This is how git has worked for years: you can checkout a non-conflicting branch without stashing. Only if none of the changes are to the same file, even if they don't conflict. > Have you customized Git to not support this? If I do "git pull" it does a fetch and then something else. I'd like to do just the part that's not a fetch (because I fetched the same remote recently). > When does it make sense to do this? I can understand deleting a remote branch (which doesn’t require this) but deleting the current local branch doesn’t seem to make sense in any normal workflow. When I've finished working on something and aren't going to work on that repo again for a bit, I'd like to delete the feature branch that I just merged remotely, but I don't want to check out anything else in particular. So I usually end up doing a git checkout --detach just so that I can delete the branch, which feels cumbersome.
- rswail 6y ago> If I do "git pull" it does a fetch and then something else. I'd like to do just the part that's not a fetch (because I fetched the same remote recently). Pull = fetch remote branches + merge remotes -> local tracking branches If you want to do the second part without the first, the git merge command will do it. From the first line in the man page for git-pull: "Incorporates changes from a remote repository into the current branch. In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD."