[Git remote repository section XI]

Welcome to the self- Python programming classroom, the last lecture we learned how to version rollback operation, this lecture we learn remote content repository, are you ready?

Speaking before a lot of class, we are operating in a local warehouse. The role of Git is an aspect of the file version control, more importantly, it is to facilitate collaborative development people. Therefore, only the local Git repository not real Git. The GitHub is a good place to create a remote warehouse.

By git remote command to see what the current remote repository.

Remember that project from GitHub clone at the beginning I successfully installed it entered its working directory?:

git remote

You will see the display:

origin

This is the remote repository project.

Plus -v can see more detailed information:

origin [email protected]:crossin/CrossinClass.git (fetch)

origin [email protected]:crossin/CrossinClass.git (push)

Cloning source address is also displayed.

When you are from a remote repository to clone a local warehouse, this address will be automatically added to your remote repository list, and was named origin.

And if it is a git repository init created locally, at the beginning git remote you can not see any information because it does not add any remote repository.

Want to add a remote repository, you can use the command:

git remote add [shortname] [url]

such as:

git remote add myremote [email protected]:crossin/CrossinClass.git

Thus, in this project will be able to myremote name to refer to the remote repository added.

Run the git remote, see if it has appeared in the list.

But at this moment, the files in your working directory and nothing has changed. Only the equivalent, you get a key to the box, and the box of stuff reduction seal intact. For the operation of the remote repository, there are a lot waiting to be frustrating.

You can now go to GitHub registered a number, and then build its own project, clone to the local. Because the project is not someone else's permission to write operations. Next we need it soon.

If you want to delete a warehouse, you use git remote rm command:

git remote rm myremote

You can put myremote this remote repository cleared from the list.

Congratulations in Python self on the road and adhere to the day, and today we talk with a remote repository of relevant content, you learn it?

Well! Today's share to end here, I hope you continue to focus Marco education official website, every day there are a lot of quality content to share with you! Disclaimer: The content and images from the network, belongs to original author, if your original copyright infringement, please inform, we will remove the content as soon as possible.

Guess you like

Origin www.cnblogs.com/woshijiuke/p/12166367.html