我对 Git 有点陌生。我想将一些文件推送到我的 Git 源(远程)。
我做了什么:
我有我的主人,我创建了一个分支来做一些工作。之后我将我的分支合并到我的主人。在我的工作期间,大量的二进制文件和项目文件在本地进行了更改/添加。我想only to add .java更改为远程服务器的文件。
(我相信我尝试过commits当我在我的分支上工作时,只是为了检查它是如何工作的。)
我的主人是最新与我的出身(这就是我做时得到的git pull
。我也做了git fetch origin
。
我总是收到(当我跑git status
):
On branch master Your branch is ahead of origin/master by 12 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean`
我尝试过了添加、提交这些文件,但正在运行git status
没有改变。我尝试做添加、提交在新分支上:
On branch NewBranch nothing to commit, working directory clean
我尝试重置头部。我在 Git 教程或 Stack Overflow 上没有找到问题的解决方案。
当然,我可以将所有文件推送到远程源,但我认为这不是一个好的解决方案。
我发现的一些重复的问题:如何推送单个文件 https://stackoverflow.com/questions/13479763/how-to-push-a-single-file-in-a-subdirectory-to-github-not-master, 如何推送仅对某些文件所做的更改? https://stackoverflow.com/questions/15937405/git-how-to-push-changes-made-to-only-certain-files, and 如何只提交一些文件? https://stackoverflow.com/questions/7239333/how-to-commit-only-some-files.