Git: Do a clone of remote repository on Mac / Linux
29, October 2019When you works with Git, you use Github or Gitlab for clones. But it is possible to do a clone on server...
I already give you a solution [FR] to do it with Tortoise Git.
Here is the solution if you use an unix environment (MacOS, Linux...).
Server configuration
First, ensure that:
- Your Git repository is configured on the server (chapter 2 of this article [FR])
- You have a SSH connection with you server, and the local Git client is correctly configured linked to the remote.
Solution
Execute the following commands:
mkdir MyProject
cd MyProject
git init
git remote add origin user@server.ext:repositories/MyProject.git
And now, you can do push, pull and fecth on the remote repository origin.
To get the commits of the remote branch, you shall do a pull.
See you in the next article.
Related topics:
- Configurer TortoiseGIT et le lier à son serveur -FR
- Automatiser le déploiement en ligne - FR
- Faire un clone d'un dépôt distant ! - FR
Add a comment