Xcode: Enable Create Git Repository after disabling it - ios

Like the Title already says:
I created a Xcode Project and i accidentally disabled : "Create Git Repository"
Does someone know, if i can enable it again ?
I don't want to delete this project and start from the beginning again

This button basically does git init.
So just call git init in your Terminal in the relevant project folder. Afterwards you can add remotes and do commits and pushes. Xcode will recognize the repository automatically.

Related

Xcode > Source Control > Create Git Repositories

I use Xcode 10 Mac OS X Mojave. I went to
Source Control > Create Git Repositories to create my initial commit
It seems success. but I'm not sure where my Xcode push my code to?
In my Xcode I went to sourcecode I see this
In my Bitbucket account, I see nothing pushed or created.
Bitbucket is the only account I linked in my Xcode > preferences.
I ran git config --list, I got
⚡️ Alimofire git config --list
credential.helper=osxkeychain
user.name=john doe
user.email=john#outlook.com
core.excludesfile=/Users/bheng/.gitignore_global
core.filemode=false
difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/Applications/SourceTree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true
push.default=matching
commit.template=/Users/bheng/.stCommitMsg
core.bare=false
core.repositoryformatversion=0
core.filemode=true
core.ignorecase=true
core.precomposeunicode=true
core.logallrefupdates=true
Where is my code now?
When you chose Source Control > Create Git Repositories, you created a local git repository on your Mac. That command doesn't create a Bitbucket repository or push changes to Bitbucket.
Use Xcode's source control navigator to put your project on Bitbucket. Open the Source Control navigator by choosing View > Navigators > Show Source Control Navigator. Select the Remotes folder, control-click, and choose Create Remote to create a remote repository on Bitbucket.
Avoid having uppercase letters in the repository name. If there are uppercase letters in the repository name, Xcode opens an alert saying An unknown error occurred. This is an issue for Bitbucket repositories, not GitHub repositories.
Choose Source Control > Push to push your changes to Bitbucket. You can find more detailed information in the following article:
Putting Your Xcode Project on GitHub, Bitbucket, or GitLab

Why not appear the files in submodules added into my Xcode project?

I have a problem with my Xcode project. I'm using submodules of frameworks like alamofire. I added this following the github steps... running the following command:
$ git submodule add https://github.com/Alamofire/Alamofire.git
and then the next step like drop into project...
But my problem is then the commit and push. When I clone the project from git using sourcetree in other computer or I remove the repo and I download this, the folder of alamofire and others sdk are empty.
If I open the xcode project is red name, because haven't the files. But in my first local repository all work and if I try change to submodule in sourcetree the files are downloaded and appear.
But if I use:
git clone --recursive https://github.com/meme/myRepo.git FOLDER_NAME
with this command all files are downloaded.
I want get the content of those submodules when I clone my repo into a computer with sourcetree.
How can I solve this to then download the repo appear directly the sdks?
As illustrated in this thread:
There is a "Recurse submodules" option when cloning under "Advanced Options".
That should be enough for your original question.
However:
nothing when pulling, checking out, or switching branched; and no manual recursive submodule update functionality.
So:
The only way I know of updating submodules in SourceTree is to manually open each submodule (and recursively open each nested submodule) and look at the "Uncommitted changed" select only submodules that appear to have change and "Reset" the changes.

How to delete all local and remote Git on Xcode 7 project

I'm working on an iOS Xcode project whose previous developer has configured and committed to local git and remote git using his account. Now I want to delete every source control existing on the project (local and remote) and recreate a new one. How can I make everything fresh so that I can commit and use the source control? (I don't have the previous developer account.)
in order to delete your local git you need to open your file system where your project is located and delete the .git folder. please notice that this folder is hidden by default so you will need to show hidden files and folders before doing it.
Delete of remote repository should be done on the server. If for example your are using github.com then you need to go to github.com and inside your repository go to settings tab and on the bottom you will see the Danger Zone there you can delete your remote repository.
The easiest way is to remove the invisible .git directory at the root level of the project. From there, you can recreate the repository and any remotes.
Be warned, this will delete all history for this project!
To remove all local and origin branch from XCode 8 follow these steps :
1. Source Controll / ProjectName/ Configure ProjectName.
2. In Configure ProjectName Window select Branches tab.
3. Select any branch name from local or origin.
4. Click on "-" icon on bottom left.
That branch will be removed from local machine.
And for removing branches from Github server you can delete repos from server.

Question marks in project navigator Xcode 5

i just updated to Xcode 5 and my project is using GIT, after update completed suddenly question marks appear in project navigator file near each file.
when i am trying to Commit i don't see what files have been changed, i cannot pull also
and when i am trying to push it gives :Push Success" message but the repository on GitHub don't updated.
You probably did not set up your git repository properly. There are ways of adding external git repositories, but they tend not to work well for github (in my experience) and always lead to these sorts of issues.
If you want to set up a remote git repository through github on XCode these are the steps you should take.
Make the repository on github. Make sure to add the .gitignore file for Objective-C.
Clone the repository.
Go to XCode, press "create new project"
Create the project in the folder you cloned the repo to. I always name it the exact same thing, but I don't know if that is necessary.
Make sure not to select create local git repository.
This will definitely create a project that is under version control by a remote git repository hosted on github.
Quick fix is to Create or Save the new project 'outside' the directory (say Desktop) that is not linked to your github/bitbucket

Adding file to SVN source control > add grayed out in XCode 4

I have SVN set up on a server and have pushed the Xcode project onto the server. SVN has been working for committing changes made to a file or multiple files back to the Source Controlled copy. However I am unable to add new files (such as when creating a new View Controller or adding an image for example) to SVN. They exist just locally and I cannot figure out a way to get them into source control.
I tried committing the file and receive this message:
I have also tried right-clicking the file, source control > Add. But that option is grayed out:
Is there something wrong with the SVN setup or with the way I have checked out the repository? Committing changes to an already existing file works just fine.
Thanks, any help would be greatly appreciated!
Xcode is setup to use Git now. If you can switch to git you'll be a much happier camper.
use git init, git add . from command prompt first and use gitignore to add the xcuserdata file to the ignore list. Once you do a commit -m "Initial" from the command prompt you should be able to start committing from Xcode.

Resources