Added pod files and pushed. How to undo? how to use gitignore in Xcode & github?

前端 未结 3 1666
你的背包
你的背包 2020-12-13 02:33

This is a two part question: 1) I have added committed and pushed all pod files to github. Is there a way I can remove them and not push them again to github?

2) I k

3条回答
  •  自闭症患者
    2020-12-13 02:55

    Things to give attention when you add /Pods into .gitignore

    If you are working in a team, your teammates may face issues while installing pods in their machines and the most likely reason is Podfile.lock.

    In summary, Podfile.lock makes sure you don't accidentally upgrade the libraries you pull in while keeping your Podfile concerned only with the new dependencies.

    Why Podfile.lock may cause problems?

    Podfile.lock locks the project with versions installed the first time and when you execute pod install again, this will only install any new library in Podfile and will not affect your existing libraries by updating them to latest code.

    In case of pulling repo does not contain /Pods, Podfile.lock locks versions of pods that do not exist in your machine because of .gitignore and expecting that these libraries are existing.

    Easy solution to go with

    Just remove Podfile.lock then execute pod install and Podfile.lock will be generated again with versions of pods you installed.

    Note: After removing Podfile.lock and installing the pods, you may interact with different versions of pods than your team.

提交回复
热议问题