【发布时间】:2015-04-17 23:09:16
【问题描述】:
我想重新添加、重新提交和重新推送所有内容。 Git 认为它已推送到远程存储库,但不知何故失败了。
以下是我所经历的步骤和结果。 0.在github.com创建远程git仓库 1.git初始化 在我的工作目录中
git add .
git 远程添加源https://github.com/me/myfiles
git push -u origin master -失败。 HTTP 错误(我没有确切的语言)
现在,当我运行“git status”时,我什么也得不到。似乎认为我已经“推送”了所有内容,但它不在 Github 中。
我检查了 .ignore 和 .exclude 文件。
我想重新添加、重新提交和重新推送所有内容。
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: Test file/ file
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
Untracked files:
(use "git add <file>..." to include in what will be committed)
nothing added to commit but untracked files present (use "git add" to track)
【问题讨论】:
-
再次
git push -u origin master -
不幸的是,这不起作用。它返回一切都是最新的,但我的 git 文件夹仍然是完全空的。
-
成功了。我拿出“-u”,现在一切都是最新的。知道为什么这可能是关键吗?