相关疑难解决方法(0)

Git,如何将origin/master重置为提交?

我通过此命令将本地主服务器重置为提交:

git reset --hard e3f1e37
Run Code Online (Sandbox Code Playgroud)

当我输入$ git status命令时,终端说:

# On branch master
# Your branch is behind 'origin/master' by 7 commits, and can be fast-forwarded.

#   (use "git pull" to update your local branch)
#
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)

由于我也要重置原点/标题,我结帐到origin/master:

$ git checkout origin/master
Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without …
Run Code Online (Sandbox Code Playgroud)

git git-checkout git-reset

223
推荐指数
3
解决办法
21万
查看次数

标签 统计

git ×1

git-checkout ×1

git-reset ×1