git remote repository -git reading machines

ready

Before you begin, you need to configure the git ssh public key to ssh keys on github

The local respo pushed to the remote repository

To create a git repository on a remote server, which can be github, they can also build their own git server.

Then the local connection to the remote server:

git remote add origin git@server-name:path/repo-name.git

git github when the server is:
git the Add Remote [email protected] Origin: familyhappy / praticeRepo.git

Note: where [email protected]: userName / praticeRepo.git is our GitHub ssh address in praticeRepo.git project, userName is the user name to use when we register on the site GitHub, praticeRepo.git we created for this project warehouse name.

Pushed to the remote repository

git push -u origin master
the contents of the local repository pushed to the remote, use git push command, in fact, the current push to the remote master branch.

Because the remote library is empty, the first time we push the master branch, coupled with the -u parameter, Git will not only master the new remote branch content push local master branch, but also the local master branch and remote associated master branch, after the push or pull upon the command can be simplified.
So after just a local warehouse after the code has been updated, submitted to the sub-local repository, you can use git push -u origin master with new content will be uploaded to the remote.

Create a local warehouse and efficient approach is done through github client.

The local synchronous remote practice:

If you create a repository on GitHub when the README option chosen is already regarded as a committed, if necessary, use the following command in the contents of the local repository to synchronize remote:
git pull [email protected]: userName / the Hello-Word .git or git pull origin master

Guess you like

Origin www.cnblogs.com/ling-javaweb/p/10972835.html