I was attempting to add a remote repository to my already in progress project. In the process of doing so all my files disappeared from the Commit section of Source Control (Using Git)
Also, all of the Frameworks that I downloaded from the internet (specifically my Parse Frameworks) disappeared from Finder and appeared red in the navigator.
Any ideas on how to fix this? I attempted to "Discard all Changes..." which proved to do nothing, and I tried dragging in newly downloaded frameworks, which also did not work. Should I just make a new project folder?
Looks like your frameworks folder got nuked/moved.
Without more info, this is my generic advice: first make a copy of the directory which encapsulates your git repo. Then look into the git commands git reset and the big hammer git reflog. Good luck.
Related
I had no source control set up for my solution.
But when I right clicked it and chose 'Add to Source Control', it spewed out the following output, which seems to be setting it all up and creating it automatically in the projects own folder.
A new Git repository has been created for you in C:\Users\Me\Documents\Sites\MySolution.
Opening repositories:
C:\Users\Me\Documents\Sites\MySolution
An existing Git repository was found in C:\Users\Me\Documents\Sites\MySolution.
Commit d59ef659 created locally in repository C:\Users\Me\Documents\Sites\MySolution
This seems like magic to me. I've dabbled in version control but have never used it seriously as most of my projects are personal and maintained by me alone. Has this option always been available?
My project had several folders that accidentally got added to my GitHub repository. I could delete them (one file at a time) from the GitHub website but that is tedious for a large number of files. I tried using git on the command line but it was conflicting with the Xcode source control updates. I would just like to do it graphically in Xcode if possible.
The closest Xcode question that I could find was this one, but it was about removing source control altogether, which I don't want to do.
I struggled with this for quite some time but it turned out to be fairly easy. I am sharing my answer below.
As long as you have your project already connected to a remote GitHub repository, all you have to do is use Finder to delete the files or folders.
Then go to Source Control and choose Commit and after that Push.
This will delete the files from your GitHub repository without you having to use the command line.
I've read that developers really need source control. Now I never used it before and I'm a bit lost with my existing projects.
How do I setup it?
There's already a File path inside of it, but it goes to nothing? I don't even know what it does in there.. I want a local git for my own. I found how to set it up with Terminal. But I think there should be a right way on doing this with Xcode and not with Terminal?
I'm sorry to say that Xcode does not have an option to place an existing project under version control. You can however use GitHub for Mac which will allow you to do this. It also has convenient merging tools and lets you push your code to GitHub.com if you like, all at the touch of a button: https://mac.github.com
It's easy enough to create a git repo from the command line though: open Terminal and navigate to the root folder of your project. Then type the following:
git init
git add .
git commit -m "initial commit"
Note that this approach as well as GitHub for Mac will version control every file in your project - which is not what Xcode does when you start a new project with Git enabled. You may run into trouble because your user interface state changes once every second - which can make committing and merging difficult.
The following article discusses this in detail:
http://pinkstone.co.uk/how-to-place-an-exiting-xcode-project-under-version-control-with-git-and-ignore-files-you-dont-want-to-track/
I am new to gitHub and have been invited to work on a private project. I am familiar with XCode and would like to use it to work on the project for it's autocompletion capabilities that I am used to. My problem is I don't know how to set this up so that I can pull the git repository, edit and test in XCode and then push. I have gone through a few tutorials on setting up git in XCode and I am successful in being able to connect to a repository I have pulled, but don't know how to use this as an XCode project once I have done so.
Here are a few specifics:
I made an SSH key for my computer and have cloned the repository through the terminal. Obviously I can update the files here and then use git commit and git push, however I want to use XCode for editing for code completion.
This project has a make file, though I don't know how to use these other than just typing "make all" in the terminal. I am assuming that I can set this up with Xcode so that when I build it uses the make file, but reading the documentation on this made me realize I don't understand enough to set this up.
I have tried making an Xcode project and then importing my files, but the problem is that Xcode insists on making a directory inside the project folder with the same name as the project where it stores all of the files. Therefore all of the addresses for my header files become wrong.
I assume that cloning a git project and then editing in Xcode is pretty standard. Does anyone have a place I can go for help?
Download SourceTree from the app store. It's free and kicks ass. You can just clone it in the terminal window using 'git clone WhateverOneYouWant -b WhicheverBranch'. Then just drag the project from the finder into the main sourceTree window.
Or alternatively, you can just grab it directly from gitHub on the main opening page of xcode. If there are no projects currently open, in the left part of the opening window, you'll see a line that says 'connect to a repository'.
Let me know if you have questions!
This isn't an exact answer to your question, but it does work.
If you install git separately and clone from the command line, you can:
Use Spotlight to Locate the Project folder you cloned
Double click the corresponding .xcodeproj file and start editing.
I have an iphone project on a mac. I set up an SCM repository and then ignored it for a while. Now I've decided to back up my source to my main PC and do source control there. I'm finding that the SCM wants to roll back my changes seemingly at random.
How can I kill SCM in Xcode on the mac? I need to tell it to leave my source files alone. Nothing is worse than making changes and having your changes replaced.
I work alone, but have about 10 projects in source control on the pc.
Thanks,
Gerry
if you want to remove svn from folder manually
check the .svn folder is deleted from your project
its in very directory and sub directory
Assuming your using Xcode: As long as you have all your files (and another back up) you can go to preferences, scm, and then just remove the repository.