renesteg
renesteg

Reputation: 571

XCode / Git, status of an updated file is no updated in source control

Guess I have an issue many may have had too. I am using a third party library. Naturally when the vendor publishes a new release I have to update the header files etc. in my project. But XCode does not come with a replace feature, so one has to Delete! the files and copy the new files into the project again. However, since I have done that, I have a header file, which keeps being in status A for added and a resource bundle (a directory with images and sound files from the SDK), which keeps telling me that it is not existing, when I want to commit the entire project.

Any idea, how I can clean up that mess? I submitted an enhance request to Apple as I find that replacing files in a project is a MUST feature.

Upvotes: 5

Views: 1767

Answers (1)

user207616
user207616

Reputation:

oh yeah the subversion problems … what I do as a last resort: delete the local files, pull the latest version and then apply the changes again. For me this issues often occur by adding or deleting folders. So I first add/delete the related files on the server (normally I use a third party app in that case, e.g. gitbox or SourceTree) and then try syncing again.

Normally it should be possible to have multiple git repo's in one project (checkout the library into your project) but I personally don't like that. Instead I have the second repo in another directory and add those files as a linked reference (the option you can choose when adding new files -> uncheck "copy items into destinations group folder"). Whenever the library changes it will automatically apply to your project. The downside is that it will not automatically check if an update is available. On the other side it's probably safer to use an older library than a new one (every time you update the library you have theoretically test your whole application for bugs)

Back to your problem. In many cases it is easier to create a new repository structure. Backup the current state and delete the repo (local or remote). Then copy the files back to the repository and sync it. Should fix nearly all cases. (… and every time I try to solve it otherwise, I end up wasting hours with trying different methods to finally rebuild the whole repo like I described above -.-)

Upvotes: 1

Related Questions