为什么我在 gitbash 上提交命令后收到消息

问题描述 投票:0回答:1

在我的 java 项目上运行 git bash 并执行以下命令后,我在 git hub 上创建了一个存储库:

git init
git add .
git commit -m "MENSAGEM"

但是提交后我收到消息:

*On branch main
nothing to commit, working tree clean*

我试过了

git remote set-url origin https://github.com/renantins/test.git 

但没用。

git github git-bash commit git-commit
1个回答
0
投票

根据您的描述,您发出了两次

git commit
命令(第一次以“MENSAGEM”作为注释),这就是为什么第二次提交说没有要提交的内容。只需使用
git log
确认您的提交。如果您想更改提交消息,可以修改上次提交。

更进一步,github推荐

git remote add origin https://....git
(在github新建的repo中给出的说明)。使用
git remote -v
检查您的回购的来源。如果它看起来不错,那么
git push -u origin main
。就是这样。

好吧,差不多了 ;-)。就我而言,我还需要建立一个令牌,因为 github 不再支持用户/密码登录。

© www.soinside.com 2019 - 2024. All rights reserved.