首页 文章

我只能将更改推送到本地存储库

提问于
浏览
1

通过Daniel Kehoe的Learn Ruby on Rails书和我've installed and configured github on my macbook. My problem is that I'我不知道为什么我的更改只是被提交并推送到我的本地存储库 . 他们刚刚赢了't show up on my github remote repos. Downloaded Github desktop for my mac and it works perfectly, pushes my changes that I make in my editor straight to my remote repository. Can' t弄清楚我的配置出错了 .

我在编辑器(Atom)中对ReadMe文档做了一些小改动,并检查终端中的app git status . 它反映了自述文件已被更改 . 然后我使用git add -A命令并尝试提交 . 它似乎工作,之后我使用push命令 . 它告诉我一切都是最新的,但当我检查我的远程回购时,我看到没有变化......

1 回答

  • 2

    让我们从头开始学习git . 你应该已经执行了一个初始git设置,如下所示:

    $ git config --global user.name "Your Name"
    $ git config --global user.email your.email@example.com
    $ git config --global push.default matching
    $ git config --global alias.co checkout
    

    然后初始化您的存储库:

    $ git init
    

    将项目文件添加到存储库

    $ git add -A
    

    然后提交我们的初始存储库更改

    $ git commit -m "Initialize repository"
    

    现在我们编辑自述文件(对自述文件进行一些更改)您提交更改

    $ git commit -am "Improve the README"
    

    然后你添加你的远程存储库,在这种情况下它是bitbucket

    $ git remote add origin git@bitbucket.org:<username>/sample_app.git
    

    最后,将其推送到远程存储库

    $ git push -u origin --all
    

    所以听起来好像所有内容都适用于自述文件提交,但您的远程存储库可能没有设置 . 这一切都来自Hartl's Rails书第1章和第3章

相关问题