为什么在github中看不到最新的文件?

为什么在github中看不到最新的文件?,git,github,version-control,Git,Github,Version Control,首先,我是github的新手: 我创建了一个新的存储库,从另一个repo导入代码,将repo克隆到我的磁盘上,将更改的文件复制到其中,称为git commit和git push,但如果我转到我的github帐户,打开repo,我看不到我的最新提交,文件也不反映我磁盘上的最新内容,但我得到以下信息: $ git pull Already up-to-date. $ git commit On branch master Your branch is up-to-date with 'origin/

首先,我是github的新手:

我创建了一个新的存储库,从另一个repo导入代码,将repo克隆到我的磁盘上,将更改的文件复制到其中,称为git commit和git push,但如果我转到我的github帐户,打开repo,我看不到我的最新提交,文件也不反映我磁盘上的最新内容,但我得到以下信息:

$ git pull
Already up-to-date.
$ git commit
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
        modified:   main.cpp
        modified:   mainwindow.cpp
        modified:   mainwindow.h
        modified:   session.cpp
        modified:   sessionstack.cpp
        modified:   sessionstack.h

Untracked files:
        cscope.out
        kterminal.kdev4

no changes added to commit
$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.

Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Username for 'https://github.com': myuser
Password for 'https://myuser@github.com': 
Everything up-to-date
我做错了什么o

您需要在git提交之前进行git添加

使用git-add是很常见的。这将阶段性地提交您的所有更改。i、 e.将它们标记为包含在下一次提交中

在提交文件之前添加文件的目的意味着您不必一次提交所有更改。例如,您可以更改十个文件,转移其中的五个文件,使用消息功能一提交它们,然后转移其余的五个文件并将它们作为功能二提交

更多信息: