Github 提交(推送)要点
我无法理解这一点。
我已经创建了一个要点。然后我运行
$ 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只是从克隆要点开始,这可能是最简单的,这样就可以为您设置origin(引用原始存储库的“远程”)。然后你就可以执行
git push 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 dogit push origin master
. For example:However, if you don't want to redo your changes, you can do:
Strictly speaking, the
git fetch origin
and-u
argument togit push origin master
are optional, but they will helpfully associate the upstream branchmaster
inorigin
with your local branchmaster
.由于您没有使用 git clone ,因此您没有远程设置。虽然 Mark Longair 的解决方案是最好的,但替代方案是:
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 命令将其发送到 github。
You just need to use the
git push
command to send that to github.