2

I have been developing an iOS application for a few months. Now, I want to push it on bitBucket. The problem is git push ignore all files related to cocoapods (e.g., project.xcworkspace Podfile, Podfile.lock, Pods, etc.)

Is there any way to push these files?

Cœur
  • 37,241
  • 25
  • 195
  • 267
chipbk10
  • 5,783
  • 12
  • 49
  • 85
  • Did you 'git add' those files? Did you commit your changes? Are you using a .gitignore file that specifies rules for those files or filetypes? – wickstopher Sep 11 '14 at 12:47
  • I am quite new to git. I tried to commit add and push. But don't know about gitignore file. – chipbk10 Sep 11 '14 at 12:48
  • Well, if the files aren't being pushed, you haven't told git to start tracking them in your repository. In any case, this free ebook is a good place to start with git: http://git-scm.com/book – wickstopher Sep 11 '14 at 12:49
  • How can I tell git to start tracking them in my repository? – chipbk10 Sep 11 '14 at 12:51
  • 1
    'git add filename' is the command you need. However, I strongly advise you to read up more on git before going any further, as it is apparent that you don't have a basic working knowledge of the system at this point. The aforementioned ebook has all the information you need. – wickstopher Sep 11 '14 at 12:52
  • I use git add * at the beginning. – chipbk10 Sep 11 '14 at 12:53
  • Well, if you add new files to your project, you need to add them as well. If you want to start tracking files in a subdirectory, you need to git add that subdirectory as well. – wickstopher Sep 11 '14 at 12:55
  • So, why I use "git add *", it add all folders (including all sub-files) except cocoapod stuffs? I have a knowledge of svn. Even, the idea of git is a little bit different in comparison to svn. But the meaning of commands like commit, add , etc... still are the same. – chipbk10 Sep 11 '14 at 12:59
  • 1
    There are some subtle differences between the commands, and some not so subtle (e.g. checkout) so you may want to read up. Check your .gitignore file. If it exists, it'll be in the root directory of your project (note the preceding '.'). – wickstopher Sep 11 '14 at 13:03

2 Answers2

1

Open your .gitignore file with a text editor (note: it's a hidden file). It's likely that it has lines like:

Pods/
Podfile

or:

Pod*

The line Pods/ is often added in some default .gitignore files found in various places around the net (example), and it tells git to not push CocoaPods dependencies.

Well, the solution is to remove or comment out those lines (comments are done with a # character in your .gitignore).

Cœur
  • 37,241
  • 25
  • 195
  • 267
0

Using git add -A to add everything.

chipbk10
  • 5,783
  • 12
  • 49
  • 85
  • Could you please be more detailed? I'm facing the same problem, I tried it without any useful result – Ahmad F Jan 11 '17 at 15:00