首页 > Web开发 > 详细

GitHub - 上传至remote repository操作

时间:2020-03-11 09:46:14      阅读:66      评论:0      收藏:0      [点我收藏+]

No local folder at the beginning: 

1. Navigate to the folder in your computer where you want to start the repository;

2. Clone the GitHub remote repo to local folder:

git clone [remote-repo-URL]

Note: This makes a copy of the specified repository, but on your local computer. Also creates a working directory that has files arranged exactly like the most recent snapshot in the download repository. Also records the URL of the remote repository for subsequent network data transfers, and gives it the special remote-repo-name “origin”.

3. Move into your newly created repo.

4. Add the remote repository:

git remote add [remote-repo-name] [remote-repo-URL]

Note: This records a new location for network data transfers.

git remote -v

Note: This lists all locations for network data transfers.

5. Stage and commit:

 $ git add [file/folder name]
 $ git commit -m "This is the message you can input"

6. Push these changes to the master branch on the origin remote repo.

git push origin master

Note: origin can be the name you write in step 4, master is the branch

p.s I do not fully understand branch and the name for this stage, just use this line is ok for me right now.

7. (option) Get the most recent copy of the files as seen in remote-repo-name

git pull [remote-repo-name] master: 

 

In local folder at the beginning: 

1. In the local work spot, add the remote repository:

git remote add [remote-repo-name] [remote-repo-URL]

Note: This records a new location for network data transfers.

git remote -v

Note: This lists all locations for network data transfers.

2. Stage and commit:

 $ git add [file/folder name]
 $ git commit -m "This is the message you can input"

3. Push these changes to the master branch on the origin remote repo.

git push origin master

Note: origin can be the name you write in step 4, master is the branch

p.s I do not fully understand branch and the name for this stage, just use this line is ok for me right now.

4. (option) Get the most recent copy of the files as seen in remote-repo-name

git pull [remote-repo-name] master

GitHub - 上传至remote repository操作

原文:https://www.cnblogs.com/yy0506/p/12460213.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!