关于Git的使用,我遇到了哪些问题? #164
Replies: 7 comments
-
如何对比本地仓库和远程之间的差异因为远程在本地有一个对应的分支,我们需要首先 git fetch 同步远程分支状态,然后使用 diff 进行比较。 可以使用
或者
效果是一样的。 |
Beta Was this translation helpful? Give feedback.
-
Git 如何恢复版本 |
Beta Was this translation helpful? Give feedback.
-
Git 如何使用远程覆盖本地的提交?如果还没有push,可以使用reset来撤销到指定的版本。比如 master
|
Beta Was this translation helpful? Give feedback.
-
如何查看未推送到远程的commit的个数?vscode 可以很方便的显示出来,但是这个如果用命令怎么找呢? 应该用 git status 查看,他会告诉你跟上游远程分支相比,提前或者落后了多少个commit 这里一切都连接很顺畅。 但从 log 图看,明明只是进行了一个合并操作,这个应该算是一个提交吧? 从这里根本ye'kan也看不出为什么是多了九个提交,这九个commit是什么 |
Beta Was this translation helpful? Give feedback.
-
如何查看一个branch是不是已经被合并了?应该可以通过 git --merged master 来查看合并到master上的分支,但是对于我们的工作流来说,不会在本地直接合并到master上,而是推送到了远程。所以问题又回到了上一条,使用git status查看分支是不是已经推送到了远程。 |
Beta Was this translation helpful? Give feedback.
-
git 撤销本地的更改,已跟踪和未跟踪的// 将已跟踪的文件恢复到上一个版本 // 删除未跟踪的文件,使用 git clean 命令 // 删除 untracked files // 连 untracked 的目录也一起删掉 // 查看将会删除哪些文件 -n |
Beta Was this translation helpful? Give feedback.
-
为什么会遇到 git 分离的情况呢? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
收集一下业务场景,方便下一步的归纳总结。
Beta Was this translation helpful? Give feedback.
All reactions