Skip to content

Commit e86a558

Browse files
committed
修改图片
1 parent d04a027 commit e86a558

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

001-Python 教程简介/003-Git Tutorial for Humans™.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,51 @@ git merge editing
4242

4343
```
4444
git log --all --decorate --oneline --graph
45-
```
45+
```
46+
47+
# 真实案例
48+
49+
[Python-Tutorial-for-Humans](https://github.com/imcda/Python-Tutorial-for-Humans)
50+
51+
## 问题一:回退版本
52+
53+
当我开始尝试一些 Github 网页版的操作的时候,经常会对远程仓库造成改变,而我的本地仓库没有变化,这个时候就存在不一致的问题了。如果我尝试的结果,不是我需要的,我就会选择回退版本,方法如下:
54+
55+
1. 本地仓库同步拉取远程仓库
56+
57+
2. 本地仓库查看版本记录
58+
59+
执行
60+
```
61+
git log
62+
```
63+
可以得到需要回退版本的 hash value
64+
65+
3. 本地仓库执行回退版本
66+
67+
执行
68+
```
69+
git reset --hard XXXhash valueXXX
70+
```
71+
72+
4. 本地仓库推送远程仓库
73+
74+
执行
75+
```
76+
git push -f
77+
```
78+
79+
`-f`的原因是,本地目前跟远程是不一致的,但是你希望远程跟本地一样,因此这样操作。
80+
81+
**思考**
82+
写到这里,我发现一个问题,如果我不拉取,不回退,直接 force push 是不是也可以,也就是在目前只有我修改了一处,又只有我在push的情况下比较合适,否则,还是要同步拉取一下远程仓库比较合适,看看到底要要回退到哪个版本。
83+
84+
85+
## 问题二:多了一个提问模板
86+
87+
我通过页面操作新增一个提问模版
88+
89+
90+
editing 分支没有 merge master 分支。
91+
92+
在编辑过 editing 分支后,回到 master 分支,使用 merge,需要输入 merge 的理由,然后 merge 成功后

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
**Python Tutorial for Humans™,适合新人、免费、中文、零基础、快速入门的 Python 教程。**
88

9-
![pth-feature-picture](https://pptwinpics.oss-cn-beijing.aliyuncs.com/pth-feature-picture_20191123171828.jpg)
9+
![pth-feature-picture](https://pptwinpics.oss-cn-beijing.aliyuncs.com/python-tutorial-banner-tiny_20191215205306.webp)
1010

1111
> 教是最好的学!
1212

0 commit comments

Comments
 (0)