Skip to content

Commit e8255a9

Browse files
committed
no message
1 parent ba57328 commit e8255a9

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

‎notes/docs/如何给我的仓库贡献.md‎

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# 前言
22

3-
本开源知识库致力成为一个计算机开源的知识框架,该项目还在萌芽起步阶段,在编写的过程中难免遇到错误和不足,非常欢迎大家能够给出自己的意见,成为这个开源项目的贡献者。
3+
本开源项目还在萌芽起步阶段,在编写的过程中难免遇到错误和不足,非常欢迎大家能够给出自己的意见,成为这个开源项目的贡献者。
44

55
这里有两种方式可以对项目进行指正和贡献。
66

7-
**issue**:如果内容上有错误和不足,可以直接在 issue 中提出来(关于 issue 可在网页上直接操作,这里就不说明)
7+
- **issue**:如果内容上有错误和不足,可以直接在 issue 中提出来(关于 issue 可在网页上直接操作,这里就不说明)
88

9-
**contribution**:当然如果你有更好的想法,可以直接贡献你的 contribution(下文将教你如何进行开源共享)
9+
- **contribution**:当然如果你有更好的想法,可以直接贡献你的 contribution(下文将教你如何进行开源共享)
1010

1111

1212

@@ -27,8 +27,8 @@
2727

2828

2929

30-
```
31-
`git clone "url you just copied"`
30+
```shell
31+
git clone "url you just copied"
3232
```
3333

3434

@@ -37,8 +37,8 @@
3737

3838
例如:
3939

40-
```
41-
`git clone [https://github.com/this-is-you/first-contributions.git](https://github.com/this-is-you/first-contributions.git)`
40+
```shell
41+
git clone https://github.com/this-is-you/first-contributions.git
4242
```
4343

4444
这里的 `this-is-you` 是你的GitHub账户. 复制你first-contributions 这个项目的内容到你的电脑。
@@ -49,20 +49,20 @@
4949

5050
在你的电脑中改变一个仓库文件夹 (如果你还没到这一步):
5151

52-
```
53-
`cd first-contributions`
52+
```shell
53+
cd first-contributions
5454
```
5555

5656
创建一个分支使用 `git checkout` 命令:
5757

58-
```
59-
`git checkout -b <add-your-name>`
58+
```shell
59+
git checkout -b <add-your-name>
6060
```
6161

6262
例如:
6363

64-
```
65-
`git checkout -b add-alonzo-church`
64+
```shell
65+
git checkout -b add-alonzo-church
6666
```
6767

6868
(分支的名称不需要 *add* 这个词, 但有一种情况可以加上,就是把你的名字加上去。)
@@ -73,14 +73,14 @@
7373

7474
用编辑器打开 `Contributors.md` 这个文件, 把你的名字加进去然后保存.在这个目录下执行 `git status`, 你就会发现已经有变化了. 把改变的文件加入你的分支只需要执行 `git add`命令:
7575

76-
```
77-
`git add Contributors.md`
76+
```shell
77+
git add Contributors.md
7878
```
7979

8080
递交刚才的文件执行 `git commit` 命令:
8181

82-
```
83-
`git commit -m "Add <your-name> to Contributors list"`
82+
```shell
83+
git commit -m "Add <your-name> to Contributors list"
8484
```
8585

8686
替换 ``成你的名字
@@ -89,11 +89,11 @@
8989

9090
推送变动执行 `git push`:
9191

92-
```
93-
`git push origin <add-your-name>`
92+
```shell
93+
git push origin <add-your-name>
9494
```
9595

96-
替换 ``成你之前创建的分支名称
96+
替换成你之前创建的分支名称
9797

9898

9999

@@ -115,46 +115,46 @@
115115

116116
首先,切换主分支
117117

118-
```
119-
`git checkout master`
118+
```shell
119+
git checkout master
120120
```
121121

122122
然后加上仓库的地址 `upstream remote url`:
123123

124-
```
125-
`git remote add upstream [https://github.com/Roshanjossey/first-contributions](https://github.com/Roshanjossey/first-contributions)`
124+
```shell
125+
git remote add upstream https://github.com/Roshanjossey/first-contributions
126126
```
127127

128128
This is a way of telling git that another version of this project exists in the specified url and we’re calling it `upstream`. Once the changes are merged, fetch the new version of my repository:
129129

130-
```
131-
`git fetch upstream`
130+
```shell
131+
git fetch upstream
132132
```
133133

134134
Here we’re fetching all the changes in my fork (upstream remote). Now, you need to merge the new revision of my repository into your master branch.
135135

136-
```
137-
`git rebase upstream/master`
136+
```shell
137+
git rebase upstream/master
138138
```
139139

140140
Here you’re applying all the changes you fetched to master branch. If you push the master branch now, your fork will also have the changes:
141141

142-
```
143-
`git push origin master`
142+
```shell
143+
git push origin master
144144
```
145145

146146
Notice here you’re pushing to the remote named origin.
147147

148148
At this point I have merged your branch ``into my master branch, and you have merged my master branch into your own master branch. Your branch is now no longer needed, so you may delete it:
149149

150-
```
151-
`git branch -d <add-your-name>`
150+
```shell
151+
git branch -d <add-your-name>
152152
```
153153

154154
同样你可以删除你远程仓库
155155

156-
```
157-
`git push origin --delete <add-your-name>`
156+
```shell
157+
git push origin --delete <add-your-name>
158158
```
159159

160160
这不是必须的, but the name of this branch shows its rather special purpose. Its life can be made correspondingly short.

0 commit comments

Comments
 (0)