gpt4 book ai didi

git - 新提交的 Git 分支没有显示

转载 作者:行者123 更新时间:2023-12-04 18:06:46 26 4
gpt4 key购买 nike

我在使用 Git 时遇到问题,我已经切换到一个新分支并提交了我的更改,但是新分支没有显示在分支列表中。

git checkout -b new-branch
git branch
develop
*new-branch
git commit -am 'new message'
git push -u origin new-branch
git branch -a
[here the new branch does not show]
git checkout origin/new-branch
error: pathspec 'origin/new-branch' did not match any file(s) known to git.

我是否遗漏了一个步骤?

最佳答案

我想我可能已经找到了答案,我需要更新我的 Remote 列表

git remote update

但这也可能是因为我没有在最新的提交中添加任何文件。您可以使用

检查要提交的文件
git status

然后,如果您想添加所有未被 .gitignore 忽略的内容,那么您只需从代码根目录运行即可。

git add .

关于git - 新提交的 Git 分支没有显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24827270/

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