3 ms·
> For example having a space or a slash between repo and a branch in a command. Actually, this one makes sense, once you understand the underlying model of how
by Denvercoder9 5y ago
> For example having a space or a slash between repo and a branch in a command.
Actually, this one makes sense, once you understand the underlying model of how git works with remote repositories, which (imo) is fairly fundamental to a distributed VCS.
They're different arguments (in your words, having a space) when you're accessing remote repositories and have to specify the location it should access. You can always substitute an URL for a repo in this case, and they fail if you cannot connect to the remote repository.
In all other cases (having a slash), you're referencing a ref in your local repository. This is a local copy of the remote repository. That means that it always works offline, but also that it doesn't sync with the remote repository. You can also substitute another ref, such as a "local" branch.
- planb 5y agoThank you . I guess this is obvious, but I never thought about it and was never sure when to use which one. Now it makes sense.
- greatgib 5y agoI think you give a general explanation of what you would like the reason to be but it does not match the commands: git fetch origin main git rebase -i origin/main Git push origin localBranch:remoteBranch For example, why not: git push origin/remoteBranch localBranch (And if you want to preserve saying that slash is just for local, you could say: origin:remoteBranch)