Closed juanmv94 closed 2 months ago
Good catch! Do you think just switching to commit hashes instead would solve the inconsistency but still provide a valuable lesson?
Definitely that could be a workaround until it’s fixed on the simulator, although I think the most common way of using the colon fetch is with a branch name origin (updating o/branch)
Alright @juanmv94 just updated the level -- let me know what you think: https://learngitbranching.js.org/?NODEMO&command=level%20remoteAdvanced6
More issues discovered affecting fetch and pull commands: I'm making a pull request fixing all these issues including the previous ones
Examples:
git clone git fetch origin main:foo
Examples:
git checkout -b foo c0 git commit git clone git fetch origin main:bar
git clone git fetch origin c0:foo
In remoteAdvance6 level we execute the command git fetch origin foo~1:bar to move remote foo~ into local bar branch, but that's actually not allowed by Git, resulting in a fatal: Invalid refspec 'foo~1:bar' message.
When using colon ":", origins can be a remote branch name, or commit hash, no ~^ modifiers allowed. Also when using a remote branch as origin, example: git fetch origin foo:bar it will update bar but also updates o/foo not being reflected in the simulator.
These same issues affects git pull commands in the same way