Junior
How can you establish a connection with a remote repository?
sobes.tech AI
Answer from AI
To establish a connection with a remote repository in Git, you can use the following commands:
-
Adding a remote repository:
git remote add origin <URL of the remote repository> # origin - the default name for the main remote repository # <URL of the remote repository> - SSH or HTTPS URL of the repository -
Cloning an existing remote repository: This command not only establishes the connection but also downloads the entire repository history.
git clone <URL of the remote repository> # Creates a local copy of the repository and automatically adds a connection with 'origin'