说它提交了,但是在GitHub中没有显示 [英] Says it commits, but in GitHub it doesn't show up

查看:116
本文介绍了说它提交了,但是在GitHub中没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Ubuntu机器上安装了rails.我设置了git并制作了一个ssh密钥以链接到我的帐户.我制作了一个要提交的存储库,并制作了一个示例项目以使用first_app进行测试.当我进行提交时,它说所有内容都已提交,但是我去了github,它不存在.我想把我的项目放在那里,但是由于某种原因它没有连接.我在Google周围搜索,什么也没看到,所以一定是我做的一些愚蠢的事情.有没有办法检查所有配置是否正确?

I just installed rails on an Ubuntu machine. I set up git and made an ssh key to link to my account. I made a repository to commit to, and made a sample project to test with called first_app. When I make commits it says it was all committed, but I go to github and it isn't there. I want to put my project up there, but it doesn't have the connection for some reason. I've googled around and I'm not seeing anything so it must be some stupid thing I did. Is there a way I can check that everything is configured right?

试图设置远程地址,但是它已经正确了.它具有正确的URL.

Tried to set the remote address, but it was already right. It has the correct URL.

Edit2:这是终端中出现的内容:

Here is what came up in the terminal:

jonny@MM061-JD:~/first_app$ cat .git/config
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = git@github.com:JonnyDoeInWisco/first_app.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
jonny@MM061-JD:~/first_app$ git remote -v
origin  git@github.com:JonnyDoeInWisco/first_app.git (fetch)
origin  git@github.com:JonnyDoeInWisco/first_app.git (push)

推荐答案

您必须将提交内容从本地存储库推送到远程存储库:

You have to push your commits from your local repository to the remote repository:

$ git commit -m "your commit message"

$ git push origin <branch_name>

用要推送到的远程分支替换<branch_name>(即master分支将是$ git push origin master).

Substitute <branch_name> with the remote branch you are pushing to (i.e. master branch would be $ git push origin master).

out 推动提交的情况下,运行时应该会看到类似的消息:

Without pushing your commit, you should see a similar message when you run:

$ git status

Git会告诉您,您已经提交了需要push到您的遥控器的内容.

Git will tell you that you have commits that you need to push to your remote.

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

验证您的远程存储库

如果您看到遥控器的最新状态,则应验证您实际上是在推送到您认为自己所在的位置/存储库:

Verify your remote repositories

If you are seeing an up-to-date status with your remote, you should verify you're actually pushing to the location/repo that you think you are:

$ git remote -v

这篇关于说它提交了,但是在GitHub中没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆