Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with pushing pod files and app extensions to Github

I have some troubles with Github:

When I am pushing my Xcode project to github, it seems that it won't push all files regarding the pods and app extensions because when I pull the project down on my other mac, I get a whole lot of errors that is not there on the original file.

Thanks in advance!

The errors I get

like image 789
Magnus Avatar asked Dec 07 '16 17:12

Magnus


People also ask

Should I add pods folder to Gitignore?

Whether or not you check in your Pods folder is up to you, as workflows vary from project to project. We recommend that you keep the Pods directory under source control, and don't add it to your . gitignore.

Should I commit pod files?

I suggest & recommend, not to commit pods directory(third party source integrated using Pod) in your Git/SVN repository. Here is sample source, suggesting you, what to commit and not. Pod is a dependency manager and may have so many third party libraries in it.

What is POD lock file?

Podfile. lock is used to make sure that every members of the team has the same versions of pods installed on the project. This file is generated after you run the command: pod install. It gets updated when you run pod install or pod update.


2 Answers

After a lot of testing I found the answer. When I used the command lines in terminal for pushing the project to Github, instead of the shortcuts in Xcode, I saw that this files were not "added" to the committing (I checked this by typing: git status). Then all I had to do was to write in Terminal: git add -A to add all the files. I committed and pushed them to Github, and now everything is working fine!

Thanks for all the help I got!

like image 60
Magnus Avatar answered Oct 23 '22 15:10

Magnus


As shallowThought is suggesting, extend your question with your .gitignore file, so we can identify the lines that are likely preventing git from tracking the pods and extensions.

If you are unsure how to find and copy this .gitignore file, do the following:

  1. In Xcode, on the left open the Project Navigator (folder icon) & select your project (usually the top item in the list).
  2. From the File Menu, choose Show in Finder.
  3. Finder will open with <your-project>.xcodeproj selected. If you don't see the folder that contains <your-project>.xcodeproj, press ⌘ 3 to tell Finder to View as Columns.
  4. De-select <your-project>.xcodeproj and instead drag the folder that contains it onto the Terminal icon (usually in the bottom of the screen). If Terminal was not there, first start Terminal; e.g. by pressing ⌘ Space and typing Terminal.
  5. Now, Terminal is showing the commandline in the same place where your .gitignore file usually is—technically it can be in any subfolder.
  6. Type pbcopy < .gitignore followed by Enter to copy the contents of the file in your clipboard.

… now post the contents in your question.


Another way to check if indeed git is not tracking your desired files is opening Terminal, and running the following command (from this answer): git ls-tree -r HEAD --name-only
If Git is not tracking the files that you require, they will not be in the list.


If you want to solve this yourself, your best bet is to remove the line from the .gitignore file that is preventing Pods etc. to be tracked. So, you're are actually doing the opposite of this SO answer ;-)
In step 3. type open -a "TextEdit" .gitignore followed by Enter to open the file.
Then remove the line(s) that you don't want ignored. Save. Now you can add/commit/push the files to GitHub.

like image 2
PDK Avatar answered Oct 23 '22 15:10

PDK