Using GitHub as a remote repository
GitHub website: https://github.com/
If you do not have a. SSH directory, or the. SSH directory does not have Id_rsa and id_rsa.pub these two files:
Ssh-keygen " [email protected] "
Copy the id_rsa.pub to SSH key. Create a new key.
Log on to GitHub and then, in the upper right corner, find the "Create a new Repo" button to create a new warehouse.
- 3. Local upload (first set up is a hint on github)
git remote add origin [email protected]:p ath/repo--u Origin master #第一次推送master分支的所有内容; Git push origin maste R #推送最新修改;
- 4. Copying from a remote library
git clone [email protected]:[github username]//code warehouse name].git
You can use the SSH protocol for replication, or you can use the HTTPS protocol for replication.
git clone https://github.com/[user name]/testgit.git
Git checkout-b a #创建一个新的分支 A,-B means to create and switch to the equivalent of the following two instructions: Git branch agit checkout a git branch #查看当前分支情况,* indicates the current Support *<name> #将 <name>-D <name> #删除分支
6. Marking tags
ID"blablabla ... " <tagname>---D <tagname> #删除一个本地标签git push origin:refs/tags/< Tagname> #删除一个远程标签
7. Using GitHub
On GitHub, you can fork the open source Warehouse;
Own the fork after the warehouse read and write permission;
You can push pull request to the official repository to contribute code.
git use (2)--Build a remote repository on GitHub