How to push & pull and clone a Git Repository

Aakar
2 min readJun 24, 2020

--

On How To — push & pull of repository from local to online git repository or Vice versa

Connect your Local Git to Online Git

In this page you will learn about how to set up and use an online Git repository and synchronize your local Git repository with your online repository

Firstly make sure that Git is installed in your computer , if not then click here

Now if the Git is installed in your computer you can proceed further

Here you will Master the following Points

  • Set up the online repository as a remote repository for your local Git repository
  • Push your commits to the online repository
  • Clone an online Git repository to your computer

Setting up an Online Git repository

  • Sign up for an account on GitHub (https://github.com).
  • Then set up an online Git repository named git-test. Note the URL of your online Git repository. Note that private repositories on GitHub requires a paid account, and is not available for free accounts.

Set the local Git repository to set its remote origin

At the prompt, type the following to set up your local repository to link to your online Git repository:

git remote add origin <repository URL>

Pushing your commits to the online repository

At the prompt, type the following to push the commits to the online repository:

git push -u origin master

Pulling a repository from the online repository

At the prompt, type the following to pull the repository from the online repository:

git pull "repository_URL"

Cloning an online repository

To clone an online repository to your computer, type the following

git clone <repository URL>

Conclusions

In this page you have learnt to set up an online Git repository, synchronize your local repository with the remote repository, and clone an online repository.

--

--