Git clone and add remote

Git has working directory, Staging Index and local repository. All changes done to the project sits in local repository until it is been pushed to the remote  repository. There are different tools that facilitates to provide code management system using git. One of them is GitHub, you may also use VSTS.

To push or sync the changes to the remote repository, you may clone the changes from remote to your local empty repository or if you have local repository you may add changes to remote repository.

To add changes to remote- github in this case-

git remote add origin remote_repository_url

To remove the remote remote origin-

 git remote rm origin

To clone from the remote-

git clone remote_repository_url

This shall be cloned in the current directory. In case if you want to new directory specify a name-

git clone remote_repository_url directory_name

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s