如何处理“最新”的事情?

How to deal with the `up-to-date` thing?

如何处理up-to-date的事情?

On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

这个怎么办? up-to-date.

你做:

git add .

向您的项目添加新文件 之后:

git commit -a

提交所有更改

下一步

git pull

创建拉取请求并将 git 与您的重复项合并

并完成:

git push

推送到服务器。

Your branch is up-to-date with 'origin/master'.

这意味着您的本地分支和您的上游分支(远程跟踪分支 origin/master 记住最后一次从源中获取的分支)是相同的。

x--x--x--x (master, origin/master)

尝试 git fetch origin 以确保。

  • 如果它回答:“Already up-to-date”,这意味着您的分支与上游存储库 origin.
    上的分支完全相同 你可能有一些本地修改(你应该添加并提交):然后你的状态会改变(说明 masterorigin 提前 1 次提交)
  • 如果它获取一些提交,那么状态将表明 ​​master 落后于 origin/master:

               y--y (origin/master)
              /
    x--x--x--x (master)
    

一个简单的 git pull 就足够了(fetch + merge origin/master into master),但是如果你有本地更改,先存储它们(git stash,然后git stash pop后拉)