pcottle / learnGitBranching

An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!
https://pcottle.github.io/learnGitBranching/
MIT License
30.61k stars 5.75k forks source link

Improve description of clone #1018

Open timhoffm opened 2 years ago

timhoffm commented 2 years ago

I find this description a bit confusing:

Technically, git clone in the real world is the command you'll use to create local copies of remote repositories (from github for example). We use this command a bit differently in Learn Git Branching though -- git clone actually makes a remote repository out of your local one. Sure it's technically the opposite meaning of the real command, but it helps build the connection between cloning and remote repository work, so let's just run with it for now.

https://github.com/pcottle/learnGitBranching/blob/a78e4d1327b8cf5eb6bcc2c0300918fab4f26419/src/levels/remote/clone.js#L71

  1. I suggest to instead phrase it in one of these ways:
  1. The example uses git clone without specifying a remote url. Maybe it's worth to require passing in some dummy url git clone https://example.com/myrepo.git to make the example more realistic. Or even make a small example repo on github `git clone https://github.com/pcottle/learnGitBranching-clone-example.git)/, so that the call would work in real life (and users can see the repo in GitHub - though the clone operation in the tutorial is still a dummy of course).
pcottle commented 2 years ago

I like your inverted language suggestion. I think technically git doesn't distinguish between which repository is the main source of truth (any repo can send PRs to another repo) but almost all common usage of Git is done with a main source of truth repository.

But yeah for the purposes of the app maybe we just say "you run this command to get a copy" and go from there as you said 😇

pcottle commented 2 years ago

Feel free to throw up a PR to wordsmith this a bit

timhoffm commented 2 years ago

I like your inverted language suggestion. I think technically git doesn't distinguish between which repository is the main source of truth (any repo can send PRs to another repo) but almost all common usage of Git is done with a main source of truth repository.

There is indeed no main source of truth. However, there is an asymmetry in that the clone has a remote origin set up, but not the other way round. Since the concept of a remote is essential, I think I'll try a two-step description.

  1. "you run this command to get a copy"
  2. "your copy still links to/remembers the original repo as remote origin".

I can try and wordsmith this in a PR, but it will be a couple of days before I come to that.