I just moved my Xcode projects to iCloud Drive to see if I could work on them across computers. So far, everything works perfectly… except git. I can't pull up the history and trying to commit gives me an error like this:
I've heard many people say that iCloud Drive is problematic and I should use GitHub, but I'm already paying for iCloud and literally all my other files are in there. That isn't to say I wouldn't be open to switching, but I'd like to know why these errors are occurring so I can make an informed decision.
Okay, I'm just spitballing here, but is there any chance it's looking for Asset.xcassets in the wrong Slidefari folder? I notice that your project folder is called Slidefari, and so is the parent of the Asset.xcassets folder.
It's been a while since I had to use XCode, and by "use" I mean "tear my hair out over," and I've only ever used GitHub for CVS, but maybe changing the name of the project folder will remove one variable? (And probably break your project BECAUSE SOFTWARE DESIGN, AMIRITE???)
Hope this helps!
Judging based on the fact that the repository works fine on the computer which it was created on, it sounds to me like some sort of git authentication issue.
It depends how your repository authenticates too. Many repo's have you generate an ssh key with keygen and submit that. I'm not 100% certain how that security works, but I'd venture to guess that the certificates and such involved are tied to your computer on a 1:1 basis.
I was thinking about moving my Xcode project to the iCloud drive but I'm concerned about the risks. I'd be curious to know if you found a solution. Thanks.
Related
I have used Git on Windows for a while, but recently changed the setting and got this.
On almost every command for Git Bash (also on PowerShell and Github Desktop) I get
git.exe is being downloaded on OneDrive
(translation may not be exactly the same)
The setting that changed recently is moving my repos to a OneDrive folder in order to have them synced between two sessions: that is work desktop and remote virtual machine.
I can see that this may not be ideal, but it really works for me since I have the same settings on both sessions, and not really get used to doing many commit-push-pull. Not the main topic here, but feel free to comment.
(Edit): Upon reading solution, there are other ways to set this syncing that doesn't mess up with the internals of Git. Look for that instead. Thanks.
In any case, the strange thing is that the notifications happen only on the Remote Virtual Machine, but not on the desktop.
I have seen some notifications about some files in the repos, which I then attribute to OneDrive being nosy about every move I make file I move. But then I've also seen files I don't know about, and theres always git.exe attached to the notification.
In the first scenario I have tried tuning down the notifications for OneDrive. Some might say Microsoft does have a background for not letting users setup their notifications, so I'm still looking.
Thanks.
Most file syncing tools like OneDrive and Dropbox operate by syncing data file by file. This is a great approach if you're working on a single word-processing document or spreadsheet. However, it's not as great when you're working with a Git repository.
When changing between branches or making a commit, Git changes and creates a lot of files all at once. In order to be synced correctly, all of the created files must be written in a similar order: all the blobs must be written, then the trees, then the commits, and then the refs can be updated. If you do this out of order, your repository can be corrupted, since you can have branches that refer to objects that don't exist (or objects that refer to other objects that don't exist).
In addition, these tools can end up deleting files you wanted to have in your working tree or recreating files you didn't. So overall, you don't want to sync any Git repository using one of these tools.
You can write a bundle file with git bundle and sync that, or you can use rsync to sync a repository provided it's idle (not being modified) when you do. Note that if you sync a working tree, Git will need to refresh all files when you sync it across to the new machine, and also Git doesn't try to defend against untrusted users who have access to the working tree.
It's also not a good idea to sync your Git installation itself via OneDrive, which is what it sounds like might be happening. Instead, install Git for Windows on each machine independently and don't try to sync it across. OneDrive should have configuration options that let you control what's synced.
Is there any way I can recover a deleted Xcode Project? One night I was making updates and the next morning the whole project was gone. Couldn't find it in the recycling bin or anywhere. The project was synced in my iCloud drive.
The app still runs in the simulator. Is this a good sign? Thanks for any help!
AFAIK, you can't.
Well, if it was sync to iCloud drive, then you can get it back from iCloud (I think so, since I never use that feature to backup). The app in your simulator doesn't help, since the code there was already compiled to machine code and unable to extract back to your original code.
Next time, make sure you have backup methods, like using source control (git, svn...) or zip and clone to drive. Good luck. Sorry for your lost, I know that feeling.
In my scenario, I have two people that do work on the same code base. Their only available workspace is a shared dev environment (where the files built are used to host the dev version of the site to boot). As such, they perform their work directly in that location. I've recently introduced source control to the project, and turned that location into a Git repository.
Let me preface by saying: Yes, I would love it if the dev host spot was a deploy-to spot, and these people had their own local copies of the source code. But that isn't feasible right now.
My question: Is it possible for two different Windows users/Git users (they have separate accounts that they can use to interact with GitHub/etc. with) to share the same folder? My hope would be that SourceTree (our weapon of choice) or Git, at least, wouldn't have a problem with this: Just show diffs of what's changed, and use the currently-logged-in user's information when making commits/other actions.
It looks like that while SourceTree has separate installation directories, it still embeds some account information in the .git folder itself. When I try to interact with Git (via a pull for example), it first tries to prompt for new credentials/etc., but shortly thereafter it says "please enter password for {other-user}" without an option to hop usernames.
It looks like we'll just have to do things the right way after all. Painful (for them) but no choice.
I have an Xcode project and I'm working with a team.
I have re-organized the files and set all the correct settings to build properly. After that, I committed to the repo and asked my teammates to pull/update and continue working on it.
However, we found that the organization of files and build settings were not reflected in my teammates' computer when they opened the same project in Xcode.
I guess it is because Xcode saves each folder/file organization and settings specific to the user (in the xcuserdatad file?). So, how do I get my team's settings/preferences to be synchronized with mine? What is the best practice?
You ask for best practices, which is a little too close to opinion for Stack Overflow sometimes, but I think this could be regarded as best practice:
Git ignore file for Xcode projects
In particular, if you are excluding from the repo any files beyond that list, that's what you should look at first.
Normally, the problem people are encountering is that things that are user-specific have made it into the repo, whereas what you're saying is that you feel there are things that are project-related that should be reflected on all the computers of all repo users, where you are not seeing this.
You likely need to be more specific about what you are and are not seeing synchronised on the two computers. For instance, if it is just whether a folder is in a collapsed or expanded state, I would definitely say that you should not want this to be synchronised over to other computers. You also mention about being able to build. If you cannot get the project to build, it is likely you may be having issues with provisioning profiles. What do the specific build error messages say?
thanks for taking a look.
I had bought the cheapest Mac Mini I could so that I could do some iOS dev, and my project has outgrown it. So I bought a MacBook Pro! It's awesome, uploading my parse cloud code took 15-20 minutes on the mini, and is instantaneous on the MBP.
However, I'm having trouble getting my Xcode project to build. Some of my frameworks are red in the Project Navigator, and I notice that their paths are /Users/[account name]/Documents/Downloads/[framework files]. It looks like on my mini I had created references instead of copying the files into my project.
I know it's against protocol here, but I haven't attempted much out of fear of breaking something. I have tried some googling, but I haven't found any relevant info. I may just be searching the wrong stuff, so feel free to mark this as duplicate and send me on the right path.
I'm using github to host a private repo for the project. What steps should I take to properly move the necessary files into my project folder, re-push the project to github, and pull back onto the other machine?
I am not going to be working from the mini anymore, at least on this project, so if it's easier to copy the file over the the MBP, put it in the project folder, and change the reference or something similar, I can do that. And I haven't made any changes to the code on the MBP, just worked on resetting up signing identities / provisioning profiles. I can always pull the project again if something gets mucked up there, but I'm nervous about changing stuff on the mini, breaking stuff, and not being able to build out my project at all.
Any tips on moving forward before I try stuff myself? Again, sorry that this breaks protocol for posting, I just want to avoid breaking my project... this isn't something a simple undo could fix, and I can't risk losing the entire project because of something stupid.
I would do this:
make sure all your projects are in source code control and committed -- good practice.
backup MacBook Pro (time machine), just in case.
copy the external dependencies over to new MacBook Pro in a way that makes sense.
one by one, delete the red frameworks and re-add them to the projects. Your choice as to copy vs reference.
Afterwards, I'd consider migration to something like Cocoapods for management of dependencies. I say consider because that's exactly the state I'm in - considering this option.
This should move you forward fairly safely. Best of luck!