Git Learning Part III - working remotely (Github)

时间:2022-12-09 04:32:19

help document of Github : https://help.github.com/

1 upload

1.1 new update

 Initialize a repository 

Create a repositoy and name it while selecting "with a  README" option.

Git Learning Part III - working remotely (Github)

tips:

1.push a new branch to the remote : $ git push -u origin <branch name>

2.add your remote: $ git remote add origin <URL>

3.check your remote: $git remote -v

Git Learning Part III - working remotely (Github)

4.change your remote: $ git remote set-url origin <URL>

Git Learning Part III - working remotely (Github)

1.2 upload directly

Type $ git push  after checking the remote to upload your repo directly.

1.3 upload modification

Edit the file and use $ git push to update modifications to remotes.

Git Learning Part III - working remotely (Github)

Git Learning Part III - working remotely (Github)

check Github:

Git Learning Part III - working remotely (Github)

2 download

2.1 download your repo

Copy the URL of the repository to clone. Simply click on the clipboard button on the right side.

Git Learning Part III - working remotely (Github)

Go to the local root folder and open a Bash Shell within it.

Git Learning Part III - working remotely (Github)

Type $ git clone https://github.com/LuoYuY/fisrt-repo.git

Git Learning Part III - working remotely (Github)

Check the folder.Git had created a new first-repo folder that contains the downloaded copy of our repository.

Git Learning Part III - working remotely (Github)

2.2 download others' work

Find the repo you want and click on the fork button. Then clone it in your Github.

Git Learning Part III - working remotely (Github)