无法在github上看到推送提交

时间:2014-05-23 13:33:57

标签: git github

我正在Coursera上完成一项任务,我们必须分配一个仓库,克隆本地版本,进行更改并提交然后推送它们。

我做了所有这些。但是,当我检查我的repo URL时,我无法看到我刚刚推出的推送提交? https://github.com/gcameron89777/ProgrammingAssignment2

我使用git config设置用户名和电子邮件的全局值。我进入了相关目录中隐藏的.git文件夹的实际文件,并查看了配置文件:

url = https://github.com/gcameron89777/ProgrammingAssignment2.git

现在,当我访问URL时,我没有看到任何提交。不应该吗?

  1. 我编辑了有问题的.R文件并将其保存。
  2. 然后我使用了这样的提交:git commit -m "added functions makeCacheMatrix and cacheMatrix"
  3. 然后我推了git push
  4. 我目前的目录一直是相关目录。

    我不应该看到我刚刚提交的最近提交的内容吗?

    编辑: 这是git status和git log的输出:

    RMIOMP1310:ProgrammingAssignment2 gavin.cameron$ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.
    
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)
    
        modified:   cachematrix.R
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    
        .DS_Store
    
    no changes added to commit (use "git add" and/or "git commit -a")
    MRMIOMP1310:ProgrammingAssignment2 gavin.cameron$ git log
    commit 7f657dd22ac20d22698c53b23f0057e1a12c09b7
    Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
    Date:   Tue Apr 22 10:09:22 2014 -0400
    
        More typos
    
    commit 873d883cbbc6de667b66349c96148203cdbbb8b1
    Merge: 9b22d21 4f84c6f
    Author: Roger D. Peng <rdpeng@gmail.com>
    Date:   Tue Apr 22 10:06:30 2014 -0400
    
        Merge pull request #1 from gustavdelius/master
    
        Fixed some minor typos.
    
    commit 9b22d21e3671f46bf535624bbb769786840d05ba
    Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
    Date:   Mon Apr 21 12:35:04 2014 -0400
    
        Clarify instructions about forking/cloning
    
    commit 4f84c6fc9c58cfcfeb788e74fbde63549ff20100
    Author: Gustav Delius <gustav.delius@gmail.com>
    Date:   Tue Apr 8 22:11:14 2014 +0100
    
        Fixed some minor typos.
    
    commit e4eed4153bd237a2dd4532fc3f40ce0e22fd0cb7
    Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
    Date:   Tue Jan 14 17:16:07 2014 -0500
    
        A few more comments on what to do
    
    commit 05bf4b3c78e2c1d679f0c94ae0431a281a9a137d
    Author: Roger D. Peng [amelia] <rdpeng@gmail.com>
    Date:   Tue Jan 14 17:10:40 2014 -0500
    :
    

1 个答案:

答案 0 :(得分:3)

来自git status

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified:   cachematrix.R

你没有add你的文件提交 - 所以你基本上没有提交任何东西。

执行以下操作:

git add -A
git commit -m "<commit message>"
git push

如果您想更好地了解git的工作原理,请阅读:http://git-scm.com/docs/gittutorial