GitHbub使用
GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.
Step 1.创建一个仓库
仓库可以用来组织项目的,可以包含文件、文件夹、图片、视频、数据集以及在项目中所需要的任何资源。
最好也闯进一个README
文件,来描述该项目。
- In the upper right corner, next to your avatar or identicon, click and then select New repository.
- Name your repository hello-world.
- Write a short description.
- Select Initialize this repository with a README.
Step 2.创建一个分支(branch)
分支是在不同版本的仓库上工作的方式,仓库默认有一个主分支master
。创建的分支实际上是master的快照。
创建一个分支,下拉master branch
,create branch
。
- Go to your new repository hello-world.
- Click the drop down at the top of the file list that says branch: master.
- Type a branch name, readme-edits, into the new branch text box.
- Select the blue Create branch box or hit “Enter” on your keyboard.
Step 3.修改并提交change
- Click the README.md file.
- Click the pencil icon in the upper right corner of the file view to edit.
- In the editor, write a bit about yourself.
- Write a commit message that describes your changes.
- Click Commit changes button.
Step 4.打开合并请求(open a pull request)
点击PULL REQUESTS
,点击NEW pull request
之后会比较修改的地方,base:
和compare:
点击Create Pull Request
Step 5.将合并请求的内容合并
- Click the green
Merge pull request
button to merge the changes into master. - Click
Confirm merge
. - Go ahead and delete the branch, since its changes have been incorporated, with the
Delete branch
button in the purple box.