Local Project Dir: /root/projects/myfirstrepo
Remote Git URL: git@remote_server_location:projects/myfirstrepo.git
Add Remote Repository
Now navigate to your project directory and use git remote add command to connect local directory to a remote repository.
# cd /root/projects/myfirstrepo
# git remote add origin git@remote_server_location:projects/myfirstrepo.git
|
Check Remote Git URL
To check remote URL in a local copy of code using the following command. In results, you will see two urls one for fetch and one for push operations.
root@subhash:~/myfirstrepo# git remote -v
origin git@remote_server_location:projects/myfirstrepo.git (fetch)
origin git@remote_server_location:projects/myfirstrepo.git (push)
|