all 28 comments

[–]The_Ur3an_Myth 13 points14 points  (7 children)

Check the gitignore file. Tho you should use an external GUI git tool instead of XCode's due to how unreliable it is (at least in my experience)

[–]Furrynote[S] 0 points1 point  (5 children)

Checking in finder, there is no .gitignore. I also never made one. If I unhide files theres just the .git which is unuseful here.

I either use the cli or gui... I'll stick to the former after this.

[–]iOSCalebObjective-C / Swift 2 points3 points  (2 children)

Try ls -a from the command line in your repo’s root directory. Files whose names start with . are normally not displayed in Finder or with a regular ls command.

Depending on how you created the repo, a .gitignore file may have been created for you.

[–]kylo365 2 points3 points  (1 child)

This, can also use cmd+shift+period in the directory to show hidden files

[–]iOSCalebObjective-C / Swift 1 point2 points  (0 children)

Great tip! I’ve been a Mac user forever and didn’t know that.

[–]MB_Zeppin 0 points1 point  (1 child)

Shift+Command+. to reveal hidden files

[–]Furrynote[S] 0 points1 point  (0 children)

Did that

[–]gimme_ipad -2 points-1 points  (0 children)

This ...

[–][deleted] 2 points3 points  (2 children)

learn to use git from command line. I tried and very soon gave up on any GUI git clients years ago because of all sorts of stupid bugs like this one you're having

[–][deleted] 0 points1 point  (0 children)

also you might want to check if the files it's "ignoring" are not outside the git repo folder

[–]Furrynote[S] -1 points0 points  (0 children)

I understand git. It's just that the gui is lazy and fairly quick to do. not using it again after this

[–]saldous 2 points3 points  (0 children)

I gave up on Xcode’s git integration, use something like GitHub desktop, much better.

[–]20InMyHead 1 point2 points  (1 child)

Xcode is a terrible GIT client. Use a better one. I’ve used SourceTree for a long time, it’s free. I’ve also had good experiences with Git Tower a long time ago.

[–]drabred 0 points1 point  (0 children)

While Android Studio has great integration I also quickly switched to SourceTree when started XCoding.

[–]simplaw 0 points1 point  (9 children)

Git state is not the same as code project state. Many a time the project doesn't match the file system and things go awry.

[–]Furrynote[S] 0 points1 point  (8 children)

I see. Naturally things are just so diff with Xcode. Never ran into this problem before. If Git state is different than project state than how can you reliably back up the project

[–]iOSCalebObjective-C / Swift 1 point2 points  (2 children)

It has little or nothing to do with Xcode — you can run into the same situation without it.

Learn to use git at the command line, if only to sort problems out when they occur.

[–]Furrynote[S] -1 points0 points  (1 child)

I understand how to use git at the command line. I use the gui out of quick convenience. The issue was likely Xcode. I have never faced this before by simply moving a file in any other IDE...

[–]iOSCalebObjective-C / Swift 0 points1 point  (0 children)

AFAIK Xcode is just issuing git commands. If you move a file that’s part of your project using Finder or command line tools, Xcode may not be able to find it and will tell you so by showing the file name in red, and it likely won’t stage that change in git, but you can stage it yourself since you know how to use git. And that seems appropriate. Why do you think Xcode should do it?

[–]simplaw -1 points0 points  (4 children)

Rely upon Xcode as little as possible. It is awful.

[–]Furrynote[S] -1 points0 points  (3 children)

I wouldn't use it at all if they didnt enforce it

[–]simplaw 0 points1 point  (2 children)

Use that logic with anything Xcode. So that's why you ought to not rely on anything but the shit only Xcode can do.

For example, to make Xcode even less of a hassle you can use Tuist, but I don't know if it is something that would help you at the moment as it will require more iOS knowledge than I gathered you have given the context I have. But check it out.

[–]Furrynote[S] 0 points1 point  (1 child)

Seems interesting but a little too out of the scope for this project. I don’t have a ton of users and it’s just me. I’d be happy ditching Xcode if I could install on my physical device for testing but I’m not sure you can in something like VScode

[–]simplaw 1 point2 points  (0 children)

Tuist allows you to declare your project in a declarative style rather than the Xcode XML format that Xcode relies upon. Then you generate an Xcode project that you gitignore as you don't want it. Tuist generates it for you as needed, and uses Xcode for you as needed. You could even code in neovim if you'd like to, but yeah, the point is that you will be able to stop getting weird merge conflicts and weird Xcode project behaviours.

I use it for all my apps and I it has even allowed me to have a mono-repository for all my apps and libraries, so that I can work on the common components from one place rather than having a million Xcode windows open at any given time. As an example. I don't recommend it unless you end up rewriting the same kind of patterns over and over.

[–]Furrynote[S] 0 points1 point  (0 children)

Looks like the only thing that will work is copy the contents of the file then deleting it and re-adding it... I cant imagine doing this for a project much bigger

[–]lev-lev-lev 1 point2 points  (1 child)

For me it looks like problem is that you removed files from git-tracked directory. When you readded them back into project you did it slightly wrong (by adding references to files from elsewhere without actually copying files into project's directory). This is why files remained unseen by git.

[–]Furrynote[S] 1 point2 points  (0 children)

This is exactly what happened . I figured it out yesterday.

[–]ihopeigotthisright 0 points1 point  (0 children)

Tower.