Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Git Ignore for Xcode Pods folder does not work

Tags:

I added a git ignore file to my Xcode project with the following commands: touch .gitignore then open .gitignore and copy and pasted this into the git ignore content (and uncommented the line that had Pods/ line) and saved the file.

But when I still try to commit (have already committed numerous times) in Xcode, the Pods file is still there and already checked to commit.

How can I have my Pod file not be checked and have the git ignore work with my Xcode project?

like image 694
ap123 Avatar asked Aug 27 '19 03:08

ap123


People also ask

How add Git ignore to Xcode?

then Open Terminal or Git Bash for Windows and go to the file directory where you wanna create a git ignore file. 1️⃣ Create a . gitignore file for your repository. 3️⃣ Now you will see the terminal like this, then paste it!

How do you add a folder to Git ignore?

If you want to maintain a folder and not the files inside it, just put a ". gitignore" file in the folder with "*" as the content. This file will make Git ignore all content from the repository.


1 Answers

This question is generic to how git works. Since you've already committed the Pods/ directory, you'll want to first make a commit that removes them. You can title this commit "Remove Pods". Do not edit the .gitignore file in this commit or else the delete will not be respected.

After you've made that commit, add the .gitignore file with the Pods/ line uncommented and make another commit title say "Add .gitignore file".

From now on, changes to the Pods/ directory will not be checked in.

like image 73
garrettmaring Avatar answered Oct 19 '22 08:10

garrettmaring