本文介绍了通过1次提交,您的分支领先于'origin / master'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Git有点新鲜,我希望有人能够解释这个消息到底意味着什么,在我的情况下。



给你一些背景信息,这是我所做的:


  • 我克隆了一个repo到我的本地计算机,创建了一个新的分支,变化。然后,我将这些更改添加到分段/跟踪区域,提交我的更改,然后将所有内容都推送到GitHub。
  • 我运行:

      git status 

    我得到:你的分支在1次提交之前是'origin / master'。

    这对我没有意义因为我没有做出任何我知道的更改。如果我运行:

      git diff 

    我什么也没得到。我没有收到我需要提交的追踪文件列表。



    发生了什么?



    注意:我与一个团队合作,所以我正在等待他们检查我的代码,并且可能会合并并将这些更改合并到主分支中。 解决方案

这意味着你已经对你的机器本地存储库提交了更改。这些提交不存在于您从中克隆的存储库中。该消息提醒您,您的存储库具有其他地方不存在的内容。



为了让git开心,你需要把你的修改推到某个地方(通常是从你克隆的地方开始)



运行 git push origin master 来解决。


I'm a little new to Git, and I'm hoping somebody can explain what this message means exactly, in my scenario.

To give you some background information, this is what I've done:

  • I've cloned a repo to my local computer, created a new branch and made some changes. Then, I added these changes to the staging/tracked area, committed my changes, and then pushed everything to GitHub.

Now, when I run:

git status

I get: "Your branch is ahead of 'origin/master' by 1 commit."

It doesn't make sense to me because I've not made any changes that I'm aware of. If I run:

git diff

I don't get anything. I don't get a list of tracked files that I need to commit.

What is happening?

Note: I work with a team, so I'm waiting for them to review my code and possibly merge and incorporate the changes to the Master branch.

解决方案

This means that you have committed changes to the repository local to your machine. Those commits do not exist in the repository that you have cloned from. That message is a reminder that your repository has things in it that do not exist anywhere else.

To make git "happy" you need to push your changes somewhere (usually from where you cloned from)

run git push origin master to resolve.

这篇关于通过1次提交,您的分支领先于'origin / master'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:19