1

In Visual Studio Code - I just chose to "add remote" so I can clone a repository and like every time, it asks me for a "Remote Name" I feel there is redundancy here and I don't know where this "Remote Name" is actually used. I feel like I'm at the doctors office filling in the date 27 times on 3 pages of paperwork.

  1. I've already had to create a filename for the folder in which I'm downloading the repository to,
  2. I've already named the repository on Github,
  3. and now I have to make a name for the remote.

What is the purpose of this "Remote Name"? What should I name it? Should I include information about the branch or something?

Thanks in advance for information about the best practice/workflow here, or anything my new programmer's mind doesn't yet grasp.

Jeremy Irons
  • 472
  • 5
  • 15
  • 3
    I can't speak to VSCode or any of the M$ stuff, but in raw Git, a *remote* is primarily a short, memorable name for a URL. Instead of remembering `ssh://git@github.com/jrandomuser/af31211/youllneverremeberTOusecapitalsinthemiddle/and/this/is/a/very/long/annoying/name/HAHA.git` every time, you just have to remember `thatguy`. – torek Aug 05 '21 at 23:12
  • 2
    Most repositories are made by cloning exactly *one* original repository, so Git uses `origin` as the first default remote name, and on the command line, you type in: `git clone ` and press ENTER. Voila, you have one cloned repo, and to refer back to the saved URL (to get or send updates), you use the name `origin`. Nothing to remember, nothing extra to type in, ever. – torek Aug 05 '21 at 23:14

1 Answers1

-1

The Git: Add Remote command is from VSCode 1.46 (Q2 2020), and is made to add remotes to existing local repository.

Asking for the Remote Name makes sense, since you are supposed to already have an existing local repository (possibly cloned from a remote one, referenced as "origin"): you might want another remote, named "upstream", to keep track of an original repository that you have forked.

Cloning a remote repository would be done with Git: Clone, which will automatically add the remote URL as "origin" for you, avoiding the redundant step of the "Remote Name" prompt.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250