In this chapter of Git Tutorial, You will learn how to add remote git repository in your local project directory. For example you are working on a project since many days, but still not added this project under Git. Now you have create a remote git repository and want to add your project under it.
- Local Project Dir:
- Remote Git URL :
Add Remote Repository
Now navigate to your project directory and use git remote add command to connect local directory to remote repository.
$ cd /home/rahul/app1 $
git remote add origin [email protected]:project/app1.git
Check Remote URL
To check remote url in local copy of code use following command. In results you will see two urls one for fetch and one for push operations.
git remote -vorigin [email protected]:project/app1.git (fetch) origin [email protected]:project/app1.git (push)