XCode4 Override Repository Offline - xcode

I decided to try out the integrated version control feature in XCode 4 (using git). I have an ssh config file that looks similar to this:
Host server
Hostname server.example.com
Port 1234
When I add the repository to XCode I give it the url git#server:repo.git. It is able to clone the repo just fine. Now comes the problem. When I want to push commits to the remote repository, XCode tells me "Repository is offline" (with the little red light). It disables the "Push" button so it won't even try. However, I can pop open a terminal and push it from there just fine (git push).
Is there any way to tell XCode to back off and ignore that "error"?
Thanks.

It doesn't look like you can. XCode appears to be checking to see if it can resolve the name of the remote machine. A workaround is to add server to your hosts file so that it resolves the address. The ip address doesn't even have to be correct since it is discarded anyway when the ssh config file is read.

Related

Create remote git repository on Windows machine from Pi

I have a project I built on a raspberry pi, including a git repository. I'd like to make it that when I type git push, it would push to my windows machine (I've had an SD card fail on me in the past, and it cost me lots of code, so I'd like an external backup). I've tried many tutorials, all of which fail due to some reason or other. My latest, is I'm trying to follow this one
I have a windows 10 machine. I went to Control Panel, System and Security, System, and copied the computer name from Computer Name (DESKTOP-UFCQ4N8).
I created a folder called f:\Shared\Git\thermostat. In windows explorer, I right-clicked on here, selected Properties, Sharing tab, and then clicked Share. I added Everyone to users, and clicked share
I then did:
f:\Shared\Git\thermostat>pushd \\DESKTOP-UFCQ4N8\thermostat
Z:\>mkdir MyGitRepo1
Z:\>cd MyGitRepo1
Z:\MyGitRepo1>git init --bare
Initialized empty Git repository in Z:/MyGitRepo1/
Z:\MyGitRepo1>popd
I finally try the following:
pi#raspberrypi:~/devel/thermostat $ git remote add origin file://DESKTOP-UFCQ4N8/thermostat/MyGitRepo1/
pi#raspberrypi:~/devel/thermostat $ git push origin master
fatal: '/thermostat/MyGitRepo1/' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
pi#raspberrypi:~/devel/thermostat $
But it does not seem to recognize the repo. I've spent quite a bit of time playing with different permutations of this, but can't seem to figure out what I'm missing. Does anyone know what I'm doing wrong?

Issue with pushing my changes to my repository

I have just set up my computer with a clean install. My project code etc was already on a secondary D drive so is unaffected.
I installed Git and TortoiseGit.
I now try to do a Push and get an error about a UriFormatException. Then it shows the password window:
I can log into my repositories OK on BitBucket web page. So what have I done wrong?
The whole point is that yesterday I was able to communicate these repositories with bitbucket.
Now I can't. ChuckieAJ is correct.
But something is wrong on my setup of TortoiseGit etc.
All I know is that I can no longer push anything to my bitbucket account. It is all messed up. :(
This helped me out:
https://help.cloudforge.com/hc/en-us/articles/215243143-Configure-TortoiseGIT-client-to-work-with-SSH-keys-on-Windows?mobile_site=true
I had to click on Git / Remote in each repository and correct the URL links to the new SSH locations and use the new Putty Key path.
Probably, ChuckieAJ should not be part of the url -- at least not with ChuckieAJ# in front of it but probably with bitbucket.org/ChuckieAJ/yourproject or something.

How do I set up Xcode source control so that my repository can be accessed by two MacBooks?

I have managed to set up Source Control locally on my MacBook (let's call it MacBook1) without any problems.
I would like to set up another MacBook (MacBook2) to access the same repository (the one stored locally on MacBook1). Basically I want both machines to be able to work on the same project at the same time and use MacBook1 as the Git repository and source control server (for lack of a better term).
I've tried clicking on my Wi-Fi status icon and Create Network, but when I do this I can no longer access the internet through Wi-Fi. Also my Git folder for my project is a hidden folder and I cannot seem to select it for sharing.
How can I share my MacBook1 local Git repository across 2 machines?
If you want to keep the repo private then use bitbucket.org, however if you want to make it public then use github.com.
I use bitbucket even though I only generally use one Mac for development as I figure their data handling standards are better than mine and I am less likely to lose data due to disk crashes etc.
You basically create an empty repo on bitbucket and then in your local working repo, do:
$ git remote add origin https://bitbucket.org/YourName/YourRepo.git
$ git push --all
$ git push --tags
(I am not associated with Atlassian).

XCode 4.2 SVN issues

I am having trouble connecting my project repository to XCode, ever since I've upgraded to 4.2. I have a local server with a forwarded port to be accessed from outside the local network. I have a DNS record pointing to the external ip. When I explicitly define the external ip (i.e https://123.456.789.000/svn/...) the repository is properly linked, no problems. This also works when I specify the internal address. The issue is when I use the repository dns - XCode shows a red dot with "Host Unreachable". I am sure this is an XCode 4.2 specific issue, because I tried this in other clients, including older XCode versions. The basic problem is - the external DNS doesn't work with https.
Any ideas?
None of the above worked for me BUT here is what worked:
I continued to get the "untrusted certficate" error in xcode 4.2 -- i could see that a prompt is being presented as readonly in xcode
So, I accessed my svn server site from via the svn command prompt utility and did a dummy operation :
svn co https://mysvnserver.com/project/
I saw the same error on the prompt as in xcode:
Error validating server certificate for 'https://mysvnserver.com:443':
- The certificate is not issued by a trusted authority. Use the
fingerprint to validate the certificate manually!
Certificate information:
- Hostname: *.svn.mysvnserver.com
....
....
....
R)eject, accept (t)emporarily or accept (p)ermanently?
Now here is the key : I hit a p here to accept (p)ermanently, and I was able to access the repository via the prompt. Next, I opened xcode and opened the repository -- everything worked flawlessly.
I had issues similar to yours, I suggest you try:
Close Xcode + Organiser
Open your svn web address in Safari (not any other browser) - using the dns name
It should come up saying the address is untrusted as the cert is a different name / address
Click show certificate and then tick the box saying always trust then continue
it may prompt you for your mac username / password to add to the keychain
Open xcode and try again using the DNS name..
The issue with xcode and accessing svn servers which have HTTPS certificates which fail any of the checks (be it host matching, self signed etc..). Opening the addresses in safari and adding as trusted solves this problem!
Run command in Terminal
svn info https://example.com/svn
It will then prompt you the "(R)eject, accept (t)emporarily or accept (p)ermanently?"
Press p and problem will be solved
You could enter your url using the port number instead of the https scheme (http://someurl.com:443/svn):
After clicking Next, Xcode shows that it can resolve the hostname:
Enter repo credentials and paths, etc..:
This is an XCode 4.2 issue and you are just going to have to wait for an update from Apple or go back to a previous version. While these links (which you've probably already read) may not solve the problem, it may at least give you further information
Setting up SVN repository in XCODE 4.2
After upgraded to Xcode 4.2, Organizer - SVN repository stopped working
https://discussions.apple.com/thread/3375258?start=0&tstart=0
Few times SVN part of XCode behaves abnormally. If your network speed is bad, XCode doesn't update the file status properly. (From past exp.)
I suggest you to try either svnX or SmartSVN clients.
As said in above responses, do check your server URL in a browser. It really helps if you are pointing to proper svn server URL or not.
I've searched for days and in the end figured that it's a bug. I'm waiting for the next update for XCode. In the meantime, I'm making do with SmartSVN....
If you really do need to use the SVN functionality in the IDE, I suggest downgrading XCode but then you will not be able to build to iOS5, which I'm sure you want to....
Your best bet is to file a bug report (which many have done already) and wait and watch.
What about just navigating in a terminal window to ~/Documents/[projectname] and doing the svn commit from there? You should get prompted to accept the cert.
Perhaps Xcode does some things behind the scenes that make this a bad idea? I just don't know if there is any difference between doing your commits within Xcode (i.e. File > Source Control > Commit) or just doing it from the command line. I've done both before and haven't noticed any problems.

Cannot get Xcode SCM to work with Gitolite based server

For whatever reason, I cannot get the built-in source control tools in Xcode 4.1 to work with the git repository I have setup on my server. The server is setup to use Gitolite.
Everything works fine from the command line. I can add the remote, push, pull, and then clone out again. I can also access Github in Xcode just fine.
Has anyone been successful getting these two tools to work together?
Any idea how I can debug this (I have no idea what Xcode is doing behind the scenes)?
The only thing that has stood out to me is that Xcode wants to include a top-level folder when accessing the repository, i.e.: git#my-server.com:folder/repository-name.git and Gitolite doesn't want you to do that. It wants: git#my-server.com:repository-name.git
I have a Gitolite 2.0.3 server running on Ubuntu 11.10, and I am able to use with the built-in SCM integration in Xcode 4.2 running on Snow Leopard.
To see log information about commits and other SCM operations, go to the Xcode log navigator (speech bubble icon in the left column, or select View > Navigators > Show Log Navigator, or press Cmd-9). The log navigator has filters to show only error messages. That should give you more information about what's going on.
One thing that stands out for me in your question is that when using Gitolite, I never use the .git suffix on the client went entering the git URI. Try omitting that and see if that makes any difference when working in Xcode. For example, I have git repositories on the server in folders like ~gitolite/repositories/project1.git or ~gitolite/repositories/apps/ios/project2.git, but when I am on the client, the git URIs look like: ssh://gitolite#myserver.com:12345/project1, or ssh://gitolite#myserver.com:12345/apps/ios/project2.

Resources