如何从cloud9推送到github?

发布于 2024-12-03 13:19:02 字数 403 浏览 2 评论 0原文

我正在尝试将一些更改从 cloud9 推送到 github 存储库,但遇到了障碍。

我可以使用 ssh 克隆 OK,一切似乎都正常,我进行更改,将更改保存在 cloud9 中(当我返回时,更改仍然存在),然后我执行 git commit 并得到:

no changes added to commit (use "git add" and/or "git commit -a")

但我只需要提交对现有文件的更改而不是添加。很明显,当我尝试 git push origin master 时,没有任何东西可以推送。

我尝试了多个 github 存储库,得到了相同的结果。

我缺少什么?

任何帮助表示赞赏!

PS哦,顺便说一句,我对 git 很烂

I am trying to push some changes from cloud9 to a github repository but I am hitting a roadblock.

I can clone OK with ssh, and everything seems to be OK, I make my changes, save the changes in cloud9 (when I go back the changes are still there), then I do git commit and get:

no changes added to commit (use "git add" and/or "git commit -a")

but I just need to commit changes to an existing file not to add. So obviously when I try to git push origin master there's nothing to push.

I tried with multiple github repos and I get the same result.

What am I missing?

Any help appreciated!

P.S. Oh, btw I suck at git

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奈何桥上唱咆哮 2024-12-10 13:19:02

该消息显示您没有添加要提交的更改/跟踪文件。

尝试使用 -am 切换到 ADD 并在一次操作中提交:

git commit -am "your message goes here"
git push

The message shows that you are not adding changed/tracked files to commit.

Try with -am switch to ADD and Commit in one operation:

git commit -am "your message goes here"
git push
有深☉意 2024-12-10 13:19:02

Git 将提交与添加更改分开。更改。您首先必须添加要在提交中显示的所有更改:

#1: Add any new files as part of the commit
#   or use git add -p to interactively select hunks to stage
git add file1 file2 …

#2: Commit to local
git commit -m "Commit message goes here"

#3: Push your commit/changes to the host (github)
git push

您现在应该将所有更改都放在 github 上。

或者,您可以进行提交,并在一行中添加/修改,这可能会将不需要的文件包含到您的变更集中。

#1 Add files commit to local
git commit -a -m "Commit message goes here"

#2 Push your commit/messages to the host (github)
git push

Git separates committing from adding changes. You first have to add all changes you want to appear in the commit:

#1: Add any new files as part of the commit
#   or use git add -p to interactively select hunks to stage
git add file1 file2 …

#2: Commit to local
git commit -m "Commit message goes here"

#3: Push your commit/changes to the host (github)
git push

You should now have all your changes on github.

Alternatively, you can do the commit, and add/modify in one line, this may include undesired files into your changeset.

#1 Add files commit to local
git commit -a -m "Commit message goes here"

#2 Push your commit/messages to the host (github)
git push
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文