Hacker News new | ask | show | jobs
by the_imp 2038 days ago
> Why can't there be an equivalent of stash that keeps track of which parts were added and which weren't?

But git stash does keep track of what it added?

> If switching branches wouldn't conflict with my current change, why do I have to stash/checkout/unstash instead of just doing it?

If your current changes apply to files which haven't changed between said branches, you don't need to stash your changes when switching between them.

> Why can't I pull without fetching?

The command for that is `git merge`.

> 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"?

The command for that is `git push origin HEAD`.

> Why is there no way to stop git from setting master as the upstream every time I do git checkout -b myfeature origin/master?

The option for that is `--no-track`.

> Why do I have to detach from a branch before deleting it?

Because the `git branch` command never changes the working tree, which in this case uses the branch name to identify its location. If the branch were to be deleted without first detaching (or switching to a different branch), stuff would break.

1 comments

> But git stash does keep track of what it added?

Added as in staged

> If your current changes apply to files which haven't changed between said branches, you don't need to stash your changes when switching between them.

Yeah, I know. So why do I have to stash when I've changed an unrelated part of the same file?

> The command for that is `git merge`.

But that doesn't know which branch is upstream, I have to tell it explicitly each time.

> The command for that is `git push origin HEAD`.

I want "git push" to just do that.

> The option for that is `--no-track`.

Yeah, I know, but I wish I could just turn it off for when I forget, or when I'm doing it from an IDE or similar.