简体   繁体   English

Git推送到新仓库,推送错误内容

[英]Git Push To New Repo Pushing Wrong Content

I tried creating a new repo on Bitbucket and pushing all of my code to it, but for some reason it is pushing another folder's contents to the repo? 我尝试在Bitbucket上创建一个新的存储库并将所有代码推送到该存储库,但是由于某种原因,它会将另一个文件夹的内容推送到该存储库? I used git status and saw that there were many other files that were untracked yet completely irrelevant. 我使用了git status ,发现还有许多其他文件未跟踪但完全不相关。

Things that I done so far - 我到目前为止所做的事情-

  • I have an existing Xcode project 我有一个现有的Xcode项目
  • I cd into the folder 我进入文件夹
  • I add my origin remote 我添加我的原点遥控器
  • I git push -u origin --all git push -u origin --all
  • I go to Bitbucket and see that another folder of mine has been pushed up 我转到Bitbucket,发现我的另一个文件夹已被推入

If I use the command ls in my directory, I see that only the files I need are there. 如果我在目录中使用命令ls ,则会看到只有我需要的文件在那里。

原来我没有在该文件夹中初始化我的git存储库...。我使用git init并成功了!

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

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