Skip to content

Commit 876ec2d

Browse files
committed
no message
1 parent 18d3509 commit 876ec2d

File tree

5 files changed

+299
-227
lines changed

5 files changed

+299
-227
lines changed

notes/EfficiencyTools/Git.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,30 @@
4545
- `git pull` 拉取远程仓库。
4646
- `git push <远程仓库> <分支>` 推送至远程仓库。
4747
- `git remote add origin https://xxx.git` 新增远程仓库`origin`
48-
- `git remote set-url origin https://xxx.git` 修改远程仓库`origin`
48+
- `git remote set-url origin https://xxx.git` 修改远程仓库`origin`
49+
50+
51+
52+
53+
54+
55+
56+
### 删除本地文件后,想从远程仓库中从新Pull最新版文件。
57+
58+
Git提示:up-to-date,但未得到删除的文件
59+
60+
原因:当前本地库处于另一个分支中,需将本分支发 Head 重置至 master
61+
62+
```git
63+
git checkout master
64+
git reset --hard12
65+
```
66+
67+
git 强行 pull 并覆盖本地文件
68+
69+
```git
70+
git fetch --all
71+
git reset --hard origin/master
72+
git pull
73+
```
74+

0 commit comments

Comments
 (0)