Git Tutorial
Connect Remote Repository To Git Local Repository
How To Connect Git Repository With GitHub ?
Open GitBash.
Navigate to git repository that needs to be linked with GitHub.
Check status.
Enter command ' git remote ' to check if any repository is linked.
![](https://static.wixstatic.com/media/3bc9da_b3b26e9603f0404fbc1c2b1b7801a117~mv2.png/v1/fill/w_607,h_221,al_c,q_85,enc_auto/3bc9da_b3b26e9603f0404fbc1c2b1b7801a117~mv2.png)
Now, enter command to link Git with GitHub, i.e. ' git remote add <name> <repo url> '.
Here, name can be defined by user and repo url is the full url of the GitHub Repository.
In my case, I'm using 'origin' as a name and my repo url is 'https://github.com/laibawaqar22/FirstRemoteRepository.git', so command will be : ' git remote add origin https://github.com/laibawaqar22/FirstRemoteRepository.git '.
![](https://static.wixstatic.com/media/3bc9da_fc7de376274c417bb5333d6471d960a2~mv2.png/v1/fill/w_632,h_241,al_c,q_85,enc_auto/3bc9da_fc7de376274c417bb5333d6471d960a2~mv2.png)
Again check remote staus, i.e. ' git remote '.
Here, you can see it's showing repository name, i.e. 'origin'.
![](https://static.wixstatic.com/media/3bc9da_7919623edff6422f8fb466e6e8fa928b~mv2.png/v1/fill/w_638,h_259,al_c,q_85,enc_auto/3bc9da_7919623edff6422f8fb466e6e8fa928b~mv2.png)
Git has been linked successfully.