推动并致力于github,但显然只是一些变化

时间:2015-10-06 03:45:45

标签: github

我已经提交并将我的更改推送到github.com但是当我删除本地目录并将repo克隆到我的本地机器时,我得到一组文件,这些文件反映了最后一次提交中的新文件的添加和absense在上次提交中删除的文件。我所做的 get是在上次提交时修改的文件,也就是说,我收到了文件,但它们是旧版本。

我还需要采取哪些其他措施?

在此之后,我对自述文件进行了一次小修改,我注意到有一条消息说“你的分支机构领先于原始/主人”。由1提交'。这是什么意思,我该如何解决?

user@pcLinux:~/backup9$ git commit
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
    modified:   README.md

no changes added to commit
user@pcLinux:~/backup9$ git add README.md
user@pcLinux:~/backup9$ git commit
[master b4c856a] Improve the formatting of README.md.
 1 file changed, 22 insertions(+), 5 deletions(-)
user@pcLinux:~/backup9$ git push https://github.com/H2ONaCl/backup9.git master
Username for 'https://github.com': H2ONaCl
Password for 'https://H2ONaCl@github.com': 
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 509 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To https://github.com/H2ONaCl/backup9.git
   f082024..b4c856a  master -> master
user@pcLinux:~/backup9$ git status
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

编辑:我删除了目录并再次克隆。似乎正在从github接收README.md修改但是对其他文件的修改不是,也就是说,其他文件仍然是旧版本。

1 个答案:

答案 0 :(得分:1)

在您的序列中,您只需添加并提交README.md,因此新克隆将反映该修改。

如果您想确保包含所有修改/添加/删除:

git add -A .
git commit -m "new commit"
git push