简体   繁体   English

当前分支落后于其远程分支

[英]Current branch is behind its remote counterpart

I'm really new to git, we have a simple project with a single branch, but at some point I decided to delete my local project folder and created a new one.我对 git 真的很陌生,我们有一个带有单个分支的简单项目,但在某些时候我决定删除我的本地项目文件夹并创建一个新文件夹。 Now I want to push it to that single branch, and it tells me the tip of current branch is behind its remote counterpart?现在我想把它推送到那个单一的分支,它告诉我当前分支的尖端在它的远程分支后面? What should I do?我应该怎么办? I needed to write the project a new and want to clear the branch as if it was created a new on the remote我需要编写一个新项目并想清除分支,就好像它是在遥控器上创建的一样

“the tip of your current branch is behind its remote counterpart” “您当前分支的尖端位于其远程分支的后面”

...means that there have been changes on the remote branch that you don't have locally. ...意味着远程分支上发生了您在本地没有的更改。

As an example, let's say that you have created a local branch named my-feature .例如,假设您创建了一个名为my-feature的本地分支。

$ git branch
  master
* my-feature
  feature

However, you want to push your changes to the remote branch named “feature” on your repository.但是,您希望将更改推送到存储库上名为“feature”的远程分支。

In order to push your branch to another branch, you may need to merge the remote branch to your current local branch.为了将您的分支推送到另一个分支,您可能需要将远程分支合并到您当前的本地分支。

In order to be merged, the tip of the remote branch cannot be behind the branch you are trying to push.为了合并,远程分支的尖端不能位于您尝试推送的分支之后。

Before pushing, make sure to pull the changes from the remote branch and integrate them with your current local branch.在推送之前,请确保从远程分支中提取更改并将它们与您当前的本地分支集成。

In order to push your branch ( my-feature ) to the feature branch, you would execute the following command:为了将您的分支( my-feature )推送到feature分支,您将执行以下命令:

$ git pull
$ git checkout my-feature
$ git merge origin/feature
$ git push origin my-feature:feature

Note: when merging the remote branch, you are merging your local branch with the upstream branch of your local repository.注意:合并远程分支时,您将本地分支与本地存储库的上游分支合并。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 git push错误:当前分支位于其远程对应对象的后面 - git push error: current branch is behind its remote counterpart 推送到远程失败,因为“当前分支的尖端位于其远程对应部分之后” - Pushing to remote fails because “tip of your current branch is behind its remote counterpart” 如何解决GitHub消息,其中显示当前分支的提示位于其远程对应的后面? - How do I resolve a GitHub message that says the tip of my current branch is behind its remote counterpart? 更新被拒绝,因为你当前分支的尖端落后于它的远程分支 - Updates were rejected because the tip of your current branch is behind its remote counterpart GitLab 更新被拒绝,因为您当前分支的尖端落后于其远程对应分支 - GitLab Updates were rejected because the tip of your current branch is behind its remote counterpart GitHub更新被拒绝,因为当前分支的提示位于其远程对应的后面 - GitHub updates were rejected because the tip of current branch is behind its remote counterpart Git 推送错误“您当前分支的提示落后于其远程对应分支” - Git push error "tip of your current branch is behind its remote counterpart" 由于远程副本后面的当前分支,推送到裸存储库被拒绝 - Pushing to a bare repository is rejected due to current branch behind remote counterpart 如何在当前分支与其远程分支之间显示日志 - How to show log between current branch and its remote counterpart 无法git push,pull表示最新消息:当前分支位于其远程对应对象的后面 - can't git push, pull says up to date: Current branch is behind it's remote counterpart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM