Github 提交(推送)要点

发布于 2024-10-21 20:49:50 字数 380 浏览 2 评论 0原文

我无法理解这一点。

我已经创建了一个要点。然后我运行

$ mkdir mygist
$ cd mygist
$ git init
$ git pull [email protected]:869085.git

然后我添加文件,更改文件并尝试提交。

$ git add .
$ git commit -a -m "Better comments"

然后我不知道如何将它发送回github并提交这个git。

I cannot understand this.

I have created a gist. Then I run

$ mkdir mygist
$ cd mygist
$ git init
$ git pull [email protected]:869085.git

Then I add files, change files and try to commit.

$ git add .
$ git commit -a -m "Better comments"

Then I do not know how to send it back to github and commit this git.

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

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

发布评论

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

评论(3

以酷 2024-10-28 20:49:50

如果您只是从克隆要点开始,这可能是最简单的,这样就可以为您设置origin(引用原始存储库的“远程”)。然后你就可以执行git push origin master。例如:

git clone [email protected]:869085.git mygist
cd mygist
# Make your changes...
git add .
git commit -m "Better comments"
git push origin master

但是,如果您不想重做更改,则可以执行以下操作:

cd mygist
git remote add origin [email protected]:869085.git
git fetch origin
# Push your changes, also setting the upstream for master:
git push -u origin master

严格来说,git fetch origin-u 参数是 git Push origin master 是可选的,但它们将有助于将 origin 中的上游分支 master 与本地分支 master 关联起来。

It's probably easiest if you just start by cloning the gist, so that origin (a "remote" that refers to the original repository) is set up for you. Then you can just do git push origin master. For example:

git clone [email protected]:869085.git mygist
cd mygist
# Make your changes...
git add .
git commit -m "Better comments"
git push origin master

However, if you don't want to redo your changes, you can do:

cd mygist
git remote add origin [email protected]:869085.git
git fetch origin
# Push your changes, also setting the upstream for master:
git push -u origin master

Strictly speaking, the git fetch origin and -u argument to git push origin master are optional, but they will helpfully associate the upstream branch master in origin with your local branch master.

长不大的小祸害 2024-10-28 20:49:50

由于您没有使用 git clone ,因此您没有远程设置。虽然 Mark Longair 的解决方案是最好的,但替代方案是:

git push [email protected]:869085.git

Since you did not use git clone you have no remote set up. While Mark Longair's solution is the best, an alternative would be:

git push [email protected]:869085.git
臻嫒无言 2024-10-28 20:49:50

您只需使用 git push 命令将其发送到 github。

You just need to use the git push command to send that to github.

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