简体   繁体   English

git push后远程缺少一些本地文件

[英]some local files missing on remote after git push

I did a git push from my local to bitbucket. 我做了从本地到位桶的git push。 This is a Django project. 这是一个Django项目。 3 files from my project level directory are still present on my local but missing from the remote on Bitbucket: manage.py, README.md, and runtime.txt. 我的项目级别目录中的3个文件仍然存在于我的本地文件中,但Bitbucket上的远程文件中却缺少这些文件:manage.py,README.md和runtime.txt。

Why did these three files not get pushed? 为什么这三个文件没有被推送? How do I fix it? 我如何解决它? And going forward, how do I have confidence in the integrity of my pushes and pulls? 展望未来,我如何对推拉的完整性充满信心? If you know Django, you know manage.py is a pretty important file. 如果您了解Django,就会知道manage.py是一个非常重要的文件。 .gitignore only has venv, staticfiles, and .pyc. .gitignore仅具有venv,staticfiles和.pyc。 And yes, I did do git status afterwards: 是的,我之后确实做了git status:

(cannon)malikarumi@Tetuoan2:~/Projects/cannon/jamf$ git status                     
On branch master                                                                   
Your branch is up-to-date with 'origin/master'.                                    
nothing to commit, working directory clean  

May be your files do not in the version control so firstly you should add manage.py, README.md, and runtime.txt files in version control using the git add command and then commit & push again. 可能是您的文件不在版本控制中,因此首先应使用git add命令在版本控制中添加manage.py,README.md和runtime.txt文件,然后再次commit & push and make sure these files are not ignore by .gitignore file. 并确保.gitignore文件不会忽略这些文件。

try git add --all and then commit and push again. 尝试git add --all ,然后再次提交并推送。 It will push all changes you made in all files. 它将推送您在所有文件中所做的所有更改。

Basically: 基本上:

git add --all

git commit -m "add all"

git push

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM