gpt4 book ai didi

git - 如何删除git中的 merge 结果

转载 作者:太空狗 更新时间:2023-10-29 14:44:44 25 4
gpt4 key购买 nike

<分区>

我来自多变的背景,在那里我可以更新到某个提交,这就是我的代码完全一样的地方,任何更改都会被删除。我试图在 git 中做同样的事情但没有成功,这就是我所做的:

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (deploy)
$ git checkout staging
Switched to branch 'staging'
Your branch is up-to-date with 'origin/staging'.

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (staging)
$ git fetch
Password for 'https://naguibihab@github.com':

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (staging)
$ git merge preprod
Already up-to-date.

此时我意识到我想以相反的方式 merge ,检查 preprod 并将暂存 merge 到其中,但首先我想确保 preprod 工作正常。所以我:

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (staging)
$ git checkout preprod
Switched to branch 'preprod'
Your branch is ahead of 'origin/preprod' by 68 commits.
(use "git push" to publish your local commits)

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (preprod)
$ git fetch
Password for 'https://naguibihab@github.com':
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/BlueChilli/omitted
55d05f4..2381261 staging -> origin/staging

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (preprod)
$ git status
On branch preprod
Your branch is ahead of 'origin/preprod' by 68 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (preprod)
$ git pull
Password for 'https://naguibihab@github.com':
Already up-to-date.

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (preprod)
$ git status
On branch preprod
Your branch is ahead of 'origin/preprod' by 68 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (preprod)
$ git reset --hard
HEAD is now at 55d05f4 merge from staff_filter

Naguib@Naguib MINGW64 /d/.Net omitted/omitted (preprod)
$ git status
On branch preprod
Your branch is ahead of 'origin/preprod' by 68 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

我想让 preprod 与 origin/preprod 保持同步,以便在该远程分支中拥有完全相同的代码。我该怎么做?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com