git还没有合并再请求pull_如何做正确的git合并/拉:你还没有结束你的合并(MERGE_HEAD存在)...

我是Git的新手,并且无法理解如何使用Git。我一直在使用CVS,所以通过一些Git的学习曲线。这里是我所有尝试的如何做正确的git合并/拉:你还没有结束你的合并(MERGE_HEAD存在)

现在我只更改了两个文件PromoServiceImpl.java和build.sql。然而,融合问题已经从“产品”分支变成了现实。

您看到的剩余文件(如ApiServiceImpl.java等)是来自其他用户的更改,但我不确定此处的表示是否表明我已更改它们。 Prob它在早期的拉命令期间被合并,现在它期望我提交它们?

不管什么是(甚至在某些谷歌搜索)我遵守命令的流量我看到以下错误:

You have not concluded your merge (MERGE_HEAD exists) Please, commit your changes before you can merge.

这里是我遵循和输出的命令序列(试图使它漂亮通过插入新行以供大家阅读)。即使在重新从库中进行修改之后,这个错误也会回来,所以我确信我在做一些错误的事情,而不是使用git的一些问题。

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Changes not staged for commit:

# (use "git add ..." to update what will be committed)

# (use "git checkout -- ..." to discard changes in working directory)

#

# modified: TryGitServices/src/main/java/com/TryGit/services/promo/impl/PromoServiceImpl.java

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

no changes added to commit (use "git add" and/or "git commit -a")

[email protected]:~/git/TryGit$ git pull origin product

From ssh://192.168.2.251/TryGit

* branch product -> FETCH_HEAD

Auto-merging TryGitResources/build/build.sql

CONFLICT (content): Merge conflict in TryGitResources/build/build.sql

Automatic merge failed; fix conflicts and then commit the result.

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Changes to be committed:

#

# modified: TryGitCore/src/main/java/com/TryGit/core/api/binding.xml

# modified: TryGitServices/src/main/java/com/TryGit/services/api/impl/ApiServiceImpl.java

# modified: TryGitServices/src/main/java/com/TryGit/services/common/impl/StartupServiceImpl.java

# modified: TryGitWeb/src/main/webapp/WEB-INF/wsdl/TryGit.wsdl

# modified: TryGitWeb/src/main/webapp/static/css/TryGit/homeDeal.css

# modified: TryGitWeb/src/main/webapp/static/css/TryGit/TryGit.css

# modified: TryGitWeb/src/main/webapp/static/img/TryGit/sprite/TryGit.png

# modified: TryGitWeb/src/main/webapp/views/admin/createPromoCode.jsp

# modified: TryGitWeb/src/main/webapp/views/admin/product/productAdmin.jsp

# modified: TryGitWeb/src/main/webapp/views/deal/homePage.jsp

#

# Unmerged paths:

# (use "git add/rm ..." as appropriate to mark resolution)

#

# both modified: TryGitResources/build/build.sql

#

# Changes not staged for commit:

# (use "git add ..." to update what will be committed)

# (use "git checkout -- ..." to discard changes in working directory)

#

# modified: TryGitServices/src/main/java/com/TryGit/services/promo/impl/PromoServiceImpl.java

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

[email protected]:~/git/TryGit$ git reset TryGitResources/build/build.sql

Unstaged changes after reset:

M TryGitResources/build/build.sql

M TryGitServices/src/main/java/com/TryGit/services/promo/impl/PromoServiceImpl.java

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Changes to be committed:

#

# modified: TryGitCore/src/main/java/com/TryGit/core/api/binding.xml

# modified: TryGitResources/build/build.sql

# modified: TryGitServices/src/main/java/com/TryGit/services/api/impl/ApiServiceImpl.java

# modified: TryGitServices/src/main/java/com/TryGit/services/common/impl/StartupServiceImpl.java

# modified: TryGitWeb/src/main/webapp/WEB-INF/wsdl/TryGit.wsdl

# modified: TryGitWeb/src/main/webapp/static/css/TryGit/homeDeal.css

# modified: TryGitWeb/src/main/webapp/static/css/TryGit/TryGit.css

# modified: TryGitWeb/src/main/webapp/static/img/TryGit/sprite/TryGit.png

# modified: TryGitWeb/src/main/webapp/views/admin/createPromoCode.jsp

# modified: TryGitWeb/src/main/webapp/views/admin/product/productAdmin.jsp

# modified: TryGitWeb/src/main/webapp/views/deal/homePage.jsp

#

# Changes not staged for commit:

# (use "git add ..." to update what will be committed)

# (use "git checkout -- ..." to discard changes in working directory)

#

# modified: TryGitResources/build/build.sql

# modified: TryGitServices/src/main/java/com/TryGit/services/promo/impl/PromoServiceImpl.java

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

[email protected]:~/git/TryGit$ git stash

Saved working directory and index state WIP on product: b8bb080 changing build.sql for RBT task

HEAD is now at b8bb080 changing build.sql for RBT task

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

nothing added to commit but untracked files present (use "git add" to track)

[email protected]:~/git/TryGit$ git reset Adding

[email protected]:~/git/TryGit$ git reset Adding

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

nothing added to commit but untracked files present (use "git add" to track)

[email protected]:~/git/TryGit$ git rm Adding

fatal: pathspec 'Adding' did not match any files

[email protected]:~/git/TryGit$ man git rm

[email protected]:~/git/TryGit$ git rm Adding

fatal: pathspec 'Adding' did not match any files

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

nothing added to commit but untracked files present (use "git add" to track)

[email protected]:~/git/TryGit$ git pull origin product

remote: Counting objects: 566, done.

remote: Compressing objects: 100% (316/316), done.

remote: Total 386 (delta 207), reused 0 (delta 0)

Receiving objects: 100% (386/386), 203.81 KiB, done.

Resolving deltas: 100% (207/207), completed with 56 local objects.

From ssh://192.168.2.251/TryGit

* branch product -> FETCH_HEAD

Auto-merging TryGitResources/build/build.sql

CONFLICT (content): Merge conflict in TryGitResources/build/build.sql

Automatic merge failed; fix conflicts and then commit the result.

[email protected]:~/git/TryGit$ git pull origin product

M TryGitCore/src/main/java/com/TryGit/core/api/binding.xml

U TryGitResources/build/build.sql

M TryGitServices/src/main/java/com/TryGit/services/api/impl/ApiServiceImpl.java

M TryGitServices/src/main/java/com/TryGit/services/common/impl/StartupServiceImpl.java

M TryGitWeb/src/main/webapp/WEB-INF/wsdl/TryGit.wsdl

M TryGitWeb/src/main/webapp/static/css/TryGit/homeDeal.css

M TryGitWeb/src/main/webapp/static/css/TryGit/TryGit.css

M TryGitWeb/src/main/webapp/static/img/TryGit/sprite/TryGit.png

M TryGitWeb/src/main/webapp/views/admin/createPromoCode.jsp

M TryGitWeb/src/main/webapp/views/admin/product/productAdmin.jsp

M TryGitWeb/src/main/webapp/views/deal/homePage.jsp

Pull is not possible because you have unmerged files.

Please, fix them up in the work tree, and then use 'git add/rm '

as appropriate to mark resolution, or use 'git commit -a'.

[email protected]:~/git/TryGit$ git add TryGitResources/build/build.sql

[email protected]:~/git/TryGit$ git pull origin product

You have not concluded your merge (MERGE_HEAD exists).

Please, commit your changes before you can merge.

[email protected]:~/git/TryGit$ gs

# On branch product

# Your branch is ahead of 'origin/product' by 1 commit.

#

# Changes to be committed:

#

# modified: TryGitCore/src/main/java/com/TryGit/core/api/binding.xml

# modified: TryGitResources/build/build.sql

# modified: TryGitServices/src/main/java/com/TryGit/services/api/impl/ApiServiceImpl.java

# modified: TryGitServices/src/main/java/com/TryGit/services/common/impl/StartupServiceImpl.java

# modified: TryGitWeb/src/main/webapp/WEB-INF/wsdl/TryGit.wsdl

# modified: TryGitWeb/src/main/webapp/static/css/TryGit/homeDeal.css

# modified: TryGitWeb/src/main/webapp/static/css/TryGit/TryGit.css

# modified: TryGitWeb/src/main/webapp/static/img/TryGit/sprite/TryGit.png

# modified: TryGitWeb/src/main/webapp/views/admin/createPromoCode.jsp

# modified: TryGitWeb/src/main/webapp/views/admin/product/productAdmin.jsp

# modified: TryGitWeb/src/main/webapp/views/deal/homePage.jsp

#

# Untracked files:

# (use "git add ..." to include in what will be committed)

#

# Adding

[email protected]:~/git/TryGit$ git pull origin product

You have not concluded your merge (MERGE_HEAD exists).

Please, commit your changes before you can merge.

[email protected]:~/git/TryGit$

+2

快速的建议:忘掉‘混帐拉’你不需要它,它的。最好的方法是在git中迷路,因为它只是一个合并后的git fetch,所以使用这两个!你可以(当然!)想看看你实际要合并的内容。在我看来,git pull是一个可能非常混乱的捷径 –

2011-12-14 16:10:36

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Git-2.21.0-64 for windows Git 2.23 Release Notes ====================== Updates since v2.22 ------------------- Backward compatibility note * The "--base" option of "format-patch" computed the patch-ids for prerequisite patches in an unstable way, which has been updated to compute in a way that is compatible with "git patch-id --stable". * The "git log" command by default behaves as if the --mailmap option was given. UI, Workflows & Features * The "git fast-export/import" pair has been taught to handle commits with log messages in encoding other than UTF-8 better. * In recent versions of Git, per-worktree refs are exposed in refs/worktrees/<wtname>/ hierarchy, which means that worktree names must be a valid refname component. The code now sanitizes the names given to worktrees, to make sure these refs are well-formed. * "git merge" learned "--quit" option that cleans up the in-progress merge while leaving the working tree and the index still in a mess. * "git format-patch" learns a configuration to set the default for its --notes=<ref> option. * The code to show args with potential typo that cannot be interpreted as a commit-ish has been improved. * "git clone --recurse-submodules" learned to set up the submodules to ignore commit object names recorded in the superproject gitlink and instead use the commits that happen to be at the tip of the remote-tracking branches from the get-go, by passing the new "--remote-submodules" option. * The pattern "git diff/grep" use to extract funcname and words boundary for Matlab has been extend to cover Octave, which is more or less equivalent. * "git help git" was hard to discover (well, at least for some people). * The pattern "git diff/grep" use to extract funcname and words boundary for Rust has been added. * "git status" can be told a non-standard default value for the "--[no-]ahead-behind" option with a new configuration variable status.aheadBehind. * "git fetch" and "git pull" reports when a fetch results in non-fast-forward updates to let the user notice unusual situation. The commands learned "--no-show-forced-updates" option to disable this safety feature. * Two new commands "git switch" and "git restore" are introduced to split "checking out a branch to work on advancing its history" and "checking out paths out of the index and/or a tree-ish to work on advancing the current history" out of the single "git checkout" command. * "git branch --list" learned to always output the detached HEAD as the first item (when the HEAD is detached, of course), regardless of the locale. * The conditional inclusion mechanism learned to base the choice on the branch the HEAD currently is on. * "git rev-list --objects" learned the "--no-object-names" option to squelch the path to the object that is used as a grouping hint for pack-objects. * A new tag.gpgSign configuration variable turns "git tag -a" into "git tag -s". * "git multi-pack-index" learned expire and repack subcommands. * "git blame" learned to "ignore" commits in the history, whose effects (as well as their presence) get ignored. * "git cherry-pick/revert" learned a new "--skip" action. * The tips of refs from the alternate object store can be used as starting point for reachability computation now. * Extra blank lines in "git status" output have been reduced. * The commits in a repository can be described by multiple commit-graph files now, which allows the commit-graph files to be updated incrementally. * "git range-diff" output has been tweaked for easier identification of which part of what file the patch shown is about. Performance, Internal Implementation, Development Support etc. * Update supporting parts of "git rebase" to remove code that should no longer be used. * Developer support to emulate unsatisfied prerequisites in tests to ensure that the remainder of the tests still succeeds when tests with prerequisites are skipped. * "git update-server-info" learned not to rewrite the file with the same contents. * The way of specifying the path to find dynamic libraries at runtime has been simplified. The old default to pass -R/path/to/dir has been replaced with the new default to pass -Wl,-rpath,/path/to/dir, which is the more recent GCC uses. Those who need to build with an old GCC can still use "CC_LD_DYNPATH=-R" * Prepare use of reachability index in topological walker that works on a range (A..B). * A new tutorial targeting specifically aspiring git-core developers has been added. * Auto-detect how to tell HP-UX aCC where to use dynamically linked libraries from at runtime. * "git mergetool" and its tests now spawn fewer subprocesses. * Dev support update to help tracing out tests. * Support to build with MSVC has been updated. * "git fetch" that grabs from a group of remotes learned to run the auto-gc only once at the very end. * A handful of Windows build patches have been upstreamed. * The code to read state files used by the sequencer machinery for "git status" has been made more robust against a corrupt or stale state files. * "git for-each-ref" with multiple patterns have been optimized. * The tree-walk API learned to pass an in-core repository instance throughout more codepaths. * When one step in multi step cherry-pick or revert is reset or committed, the command line prompt script failed to notice the current status, which has been improved. * Many GIT_TEST_* environment variables control various aspects of how our tests are run, but a few followed "non-empty is true, empty or unset is false" while others followed the usual "there are a few ways to spell true, like yes, on, etc., and also ways to spell false, like no, off, etc." convention. * Adjust the dir-iterator API and apply it to the local clone optimization codepath. * We have been trying out a few language features outside c89; the coding guidelines document did not talk about them and instead had a blanket ban against them. * A test helper has been introduced to optimize preparation of test repositories with many simple commits, and a handful of test scripts have been updated to use it. Fixes since v2.22 ----------------- * A relative pathname given to "git init --template=<path> <repo>" ought to be relative to the directory "git init" gets invoked in, but it instead was made relative to the repository, which has been corrected. * "git worktree add" used to fail when another worktree connected to the same repository was corrupt, which has been corrected. * The ownership rule for the file descriptor to fast-import remote backend was mixed up, leading to an unrelated file descriptor getting closed, which has been fixed. * A "merge -c" instruction during "git rebase --rebase-merges" should give the user a chance to edit the log message, even when there is otherwise no need to create a new merge and replace the existing one (i.e. fast-forward instead), but did not. Which has been corrected. * Code cleanup and futureproof. * More parameter validation. * "git update-server-info" used to leave stale packfiles in its output, which has been corrected. * The server side support for "git fetch" used to show incorrect value for the HEAD symbolic ref when the namespace feature is in use, which has been corrected. * "git am -i --resolved" segfaulted after trying to see a commit as if it were a tree, which has been corrected. * "git bundle verify" needs to see if prerequisite objects exist in the receiving repository, but the command did not check if we are in a repository upfront, which has been corrected. * "git merge --squash" is designed to update the working tree and the index without creating the commit, and this cannot be countermanded by adding the "--commit" option; the command now refuses to work when both options are given. * The data collected by fsmonitor was not properly written back to the on-disk index file, breaking t7519 tests occasionally, which has been corrected. * Update to Unicode 12.1 width table. * The command line to invoke a "git cat-file" command from inside "git p4" was not properly quoted to protect a caret and running a broken command on Windows, which has been corrected. * "git request-pull" learned to warn when the ref we ask them to pull from in the local repository and in the published repository are different. * When creating a partial clone, the object filtering criteria is recorded for the origin of the clone, but this incorrectly used a hardcoded name "origin" to name that remote; it has been corrected to honor the "--origin <name>" option. * "git fetch" into a lazy clone forgot to fetch base objects that are necessary to complete delta in a thin packfile, which has been corrected. * The filter_data used in the list-objects-filter (which manages a lazily sparse clone repository) did not use the dynamic array API correctly---'nr' is supposed to point at one past the last element of the array in use. This has been corrected. * The description about slashes in gitignore patterns (used to indicate things like "anchored to this level only" and "only matches directories") has been revamped. * The URL decoding code has been updated to avoid going past the end of the string while parsing %-<hex>-<hex> sequence. * The list of for-each like macros used by clang-format has been updated. * "git branch --list" learned to show branches that are checked out in other worktrees connected to the same repository prefixed with '+', similar to the way the currently checked out branch is shown with '*' in front. (merge 6e9381469e nb/branch-show-other-worktrees-head later to maint). * Code restructuring during 2.20 period broke fetching tags via "import" based transports. * The commit-graph file is now part of the "files that the runtime may keep open file descriptors on, all of which would need to be closed when done with the object store", and the file descriptor to an existing commit-graph file now is closed before "gc" finalizes a new instance to replace it. * "git checkout -p" needs to selectively apply a patch in reverse, which did not work well. * Code clean-up to avoid signed integer wraparounds during binary search. * "git interpret-trailers" always treated '#' as the comment character, regardless of core.commentChar setting, which has been corrected. * "git stash show 23" used to work, but no more after getting rewritten in C; this regression has been corrected. * "git rebase --abort" used to leave refs/rewritten/ when concluding "git rebase -r", which has been corrected. * An incorrect list of options was cached after command line completion failed (e.g. trying to complete a command that requires a repository outside one), which has been corrected. * The code to parse scaled numbers out of configuration files has been made more robust and also easier to follow. * The codepath to compute delta islands used to spew progress output without giving the callers any way to squelch it, which has been fixed. * Protocol capabilities that go over wire should never be translated, but it was incorrectly marked for translation, which has been corrected. The output of protocol capabilities for debugging has been tweaked a bit. * Use "Erase in Line" CSI sequence that is already used in the editor support to clear cruft in the progress output. * "git submodule foreach" did not protect command line options passed to the command to be run in each submodule correctly, when the "--recursive" option was in use. * The configuration variable rebase.rescheduleFailedExec should be effective only while running an interactive rebase and should not affect anything when running a non-interactive one, which was not the case. This has been corrected. * The "git clone" documentation refers to command line options in its description in the short form; they have been replaced with long forms to make them more recognisable. * Generation of pack bitmaps are now disabled when .keep files exist, as these are mutually exclusive features. (merge 7328482253 ew/repack-with-bitmaps-by-default later to maint). * "git rm" to resolve a conflicted path leaked an internal message "needs merge" before actually removing the path, which was confusing. This has been corrected. * "git stash --keep-index" did not work correctly on paths that have been removed, which has been fixed. (merge b932f6a5e8 tg/stash-keep-index-with-removed-paths later to maint). * Window 7 update ;-) * A codepath that reads from GPG for signed object verification read past the end of allocated buffer, which has been fixed. * "git clean" silently skipped a path when it cannot lstat() it; now it gives a warning. * "git push --atomic" that goes over the transport-helper (namely, the smart http transport) failed to prevent refs to be pushed when it can locally tell that one of the ref update will fail without having to consult the other end, which has been corrected. * The internal diff machinery can be made to read out of bounds while looking for --function-context line in a corner case, which has been corrected. (merge b777f3fd61 jk/xdiff-clamp-funcname-context-index later to maint). * Other code cleanup, docfix, build fix, etc. (merge fbec05c210 cc/test-oidmap later to maint). (merge 7a06fb038c jk/no-system-includes-in-dot-c later to maint). (merge 81ed2b405c cb/xdiff-no-system-includes-in-dot-c later to maint). (merge d61e6ce1dd sg/fsck-config-in-doc later to maint).
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。
当你使用 `git pull` 时,如果你的本地仓库历史记录与远程仓库不一致,就会出现拒绝合并无关历史的错误。 此时,你可以使用 `git fetch` 命令来获取远程仓库的最新代码,并且创建一个远程分支的本地副本。然后,你可以通过 `git merge` 命令将远程分支合并到你的本地分支上。 具体步骤如下: 1. 使用 `git fetch` 命令获取远程仓库的最新代码,创建一个远程分支的本地副本: ``` git fetch origin ``` 2. 查看本地分支与远程分支的差异: ``` git log HEAD..origin/master --oneline ``` 如果你看到了一条类似于“refusing to merge unrelated histories”的错误信息,说明你的本地仓库历史记录与远程仓库不一致。 3. 使用 `git merge` 命令将远程分支合并到你的本地分支上: ``` git merge origin/master --allow-unrelated-histories ``` 这里的 `--allow-unrelated-histories` 参数告诉 Git 允许合并无关历史。 4. 解决合并冲突。 如果在合并过程中出现了冲突,你需要手动解决它们。你可以使用 `git status` 命令查看哪些文件有冲突,然后打开这些文件并解决它们。解决完冲突之后,使用 `git add` 命令将修改后的文件添加到暂存区,最后使用 `git commit` 命令提交合并的结果。 5. 推送到远程仓库。 完成合并之后,你可以使用 `git push` 命令将本地分支的修改推送到远程仓库。 希望这个回答可以帮助到你!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值