XCode, Git and MediaTemple (gs) - xcode

I'm wondering if anyone's managed to connect to a self-hosted Git repository on a Mediatemple GridServer (gs) via XCode? I tried setting this up last night, and this is as far as I've got:
Installed Git on my Mac(s)
Created subdomain for git (git.blahblah.com) on my gs service via Terminal SSH
Created empty repository within subdomain (git.blahblah.com/repo/repo.git) via Terminal SSH
Clicked on 'Connect to repo' from XCode's launch menu
Entered repo address (ssh://git.blahblah.com:22/repo/repo.git) in XCode's address bar
Clicked 'clone' once XCode has found the repo and is telling me that "Authentication [is] required"
Chosen the appropriate local folder on my machine to clone the repo to
Tried to enter username and password specified in MT admin panel - the same ones that I used via Terminal SSH to set up the repo in the first place
Get booted with an error message: either 'incorrect username and password' (they're not) or 'specified address does not appear to be a repository, connection unexpectedly terminated by host' (or similar)
Cry. Repeatedly.
Getting to step 6 causes my IP to be blocked by MT, even if I'm logged into the web control panel from the same IP at the same time. Unblocking the IP via the MT control panel has no effect; the IP is blocked as soon as I try and connect via XCode again.
I suspect it's actually step 4 that's causing problems as XCode is trying to 'ping' the repo without credentials as you type in the address (to resolve connectivity).
Has anyone got this working, or do I need to look at hosting my Git repos elsewhere? I'd rather not spend more money on hosting when I have a service that should suit this purpose sitting unused.

After several online sessions with MediaTemple support I've come to the conclusion that it's not going to work.
While I can host a repository on my own gs service just fine, the way that XCode tries to connect to it causes my IP to be blocked every single time. As the blocking is automatic (and can't be turned off) then it seems XCode and MediaTemple have reached an impasse.
It's not a huge issue as I'm the only developer on this project, and I can always use DropBox instead (I was just trying to find a better way of keeping versioned backups across my laptop and desktop). If I really need Git I can use another tool or Terminal.
If I had to point fingers, I'd blame XCode: it seems its support for Git is rather sketchy beyond connecting to an open, gitHub-hosted repository.

Quick update: the solution I've managed to get working is to set up an account on BitBucket, create a project and add it to local Git, commit that to BitBucket and then connect to BitBucket using XCode. I downloaded SourceTree for extra Git activity as per Stefan's suggestion, as I'm still not 100% comfortable using Terminal (I just like GUIs, is that wrong?).
Everything seems to be running smoothly so far; it's just a little annoying that I had to use a third party for Git when I thought my server (which I'm already paying for) could do the job.

Related

GIT Client on Windows Complaining about Ownership

With great difficulty due to my limited knowledge of Linux, I set up a GIT server on my Raspberry Pi. It works great except for one thing that's been driving me nuts. I've used every Google fu move I can think of and I've gotten nowhere.
I'm using Git Extensions as the client on 3 Windows machines. One at work (no problems) and 2 at home. The local repository at home is on a shared NAS drive on my LAN. It works fine on my main computer, but when I try to access it on my secondary computer, I get the following error:
warning: '//NAS/REPOSITORY' is owned by:
'S-1-5-...'
but the current user is:
'S-1-5-...'
where 'S-1-5-...' is two different really long alphanumeric strings that mean nothing to me. It says warning, but then whenever I try to do anything I immediately I get errors I can't decipher after that like:
fatal: this operation must be run in a work tree
or
fatal: No names found, cannot describe anything.
I'm the only user, using the same windows account, username, email address, etc. configured in Git Extensions. As I understand it on the server end, the only user is git which I use for all machines.
As a workaround, I'm able to clone the repository to a different folder on my secondary computer and I have no problems with GIT, but I have problems with my code because it expects things to be in a certain directory. I can change that based on the user, but as far as my code knows, I am the same user on both machines (because I am!). So that is not a good solution. I want to be able to work in the same folder on my NAS no matter what computer I'm using.
-Is there a way to configure GIT or GIT Extensions (I'm not totally sure who is doing the complaining) to not care about ownership? I've tried cloning as a Public Repository, but I guess that doesn't mean what it seems to mean because I get the same errors.
-How do I know and/or configure what user GIT or GIT Extensions thinks I am?

Does the Netbeans 8.2 GitHub facility really work in Windows 10?

I've been trying for the lase week to use GitHub from NB from a Windows 10 machine. Very little success.
The problem is the first Push step (Next) seems to time out will trying to connect, giving a Fail to Connect error. If Next is clicked again it often seems to connect... no more "failed to connect" message. However, the Finish step fails with a "cannot open git receive pack" message. On rare occasion, both steps succeed.
I am aware that there have been reported Windows 10 page load load time issues from the beginning, so am suspicious. But I report this thinking I am probably not the only person with the problem. For now, NB GitHub is useless. Too bad.
Turns out I had a network issue. Recently page loads and other Internet operations have been slow, and finally stopped altogether. I rebooted my cable modem, presumably resulting in a new IP from my ISP (Spectrum). And now the Push is working
Try first the first push from a Git for Windows in a CMD session, possibly using a simplified PATH, for testing.
If that does work, check if NetBeans has the same issue (pushing to a GitHub repo) with an HTTPS and/or an SSH URL.

TortoiseGit asking for password on password-less login setup

After months of uninterrupted password-less work, my TortoiseGit started to ask me for a password on some of my remotes, when pushing / pulling. I'm seeking a solution to fix this, as this can drive me crazy.
To underline: I want to remain on SSH-based password-less login, so any solutions that assume adding password to URL or permanently storing password in TortoiseGit configuration is not an option for me.
What I found out so far:
My problem is not related to GitHub; I don't use it in TortoiseGit and it happens on other remotes.
I do have SSH, not HTTPS, address as repo's URL and I don't have git clone-like stuff in it.
I can push/pull the same repository using Netbeans (and my Netbeans has Select Configured Git Repository Location option checked, so it uses the same remote configuration).
I can't push/pull remote using Git GUI, reason the same: asking for user password.
This is not related to a particular system or machine (SSH key), as it happens on both my work computer (32-bit Win 7) and home one (64-bit Win 7). Both of course uses different SSH key (see comment to this answer, which claims, that problem is related to 32-bit version of Windows; this is not true, it happens on 64-bit Windows as well).
Repository, this happens on, isn't empty -- I heard and even been personally affected, that sometimes TortoiseGit gets wako and asks for password on password-less login remote, until that remote is empty.
This is not related to a particular remote -- TortoiseGit works fine, without asking for password on some repositories (i.e. BitBucket) but "dies" asking for it on some other (i.e. in local dev network).
To make things even worse, there are certain remotes, on which TortoiseGit on my home computer fails, asking for password, while the very same remote accessed from home computer works just fine. And vice-versa. I set both machines for password-less login using the same steps; only SSH keys differs.
Things I did so far (and didn't solve the problem):
Changing SSH client (TortoiseGit -> Settings -> Network) to both Git\bin\ssh.exe (as suggested in here) and to C:\Program Files\PuTTy\plink.exe.
Using credential helper doesn't helped and I heard that it works for HTTPS only, not for SSL.
Downloading git-credential-wincred.exe and putting it to Git for Windows / msysgit folder didn't help as well; I've already had it there (different version / filesize; checked on both).
This issue is clearly bind to asking for user password, so git did not exit cleanly (exit code 128) error following it doesn't have any other source except missing password and most solutions given here, like crashed git, locked file, missing user e-mail are not solution for me.
OK, that's the farest point I've reached. And still nothing. Can anyone come up with something new, that I should try to solve this issue?
I confirm that "storing password" or _netrc file, or any credential helpers are for https url only, and have nothing to do with SSH.
The usual debugging ssh steps apply, starting by making sure that %HOME% is defined when TortoiseGit is launched, and %HOME%/.ssh exists, and contains the default keys id_rsa and id_rsa.pub.
In a git bash session, you can do a ssh -Tvvv yourRemoteServer to see what the debug error message sequence is, as explained here.
You also can check the result of a GIT_TRACE=2 git push test master, to see if the issue is limited to TortoiseGit and if the verbose output leaves any clue (see here).
Try switching ssh client between putty and openssh to see if TortoiseGit fairs better with one or the other.
The issue appeared yesterday and it took me 2-3 hours of trying all sorts of stuff to fix it. I also contacted server administrator, who claimed not to have done any changes in config in the past days. Hence I put bounty on this question. I also gave it a try today, but still negative. Finally, right now, I made another attempt just to copy the message to my friend, and, all of the sudden, all my repos started to work!
I am absolutely sure I didn't touch configs, it must have been some sort of timeout which took more than 16 hours. I have no idea what the problem was. All I can conclude is that waiting till the next day might help...

After upgraded to Xcode 4.2, Organizer - SVN repository stopped working

I recently upgraded my Xcode to 4.2. Since then my Organizer-Repository stopped working. Initially it said "Host is unreachable" and placed red dot every where.
In the same Mac 10.6.8, i do have SvnX and it works with same SVN location without any problem. I also tested this in Safari and found it is working (Server supports VisualSVN). Only Xcode is finding problem with this location.
I even appended my private/etc/host files with
svn.ip.address my-svn-pet-name
and used that in my xcode following this post. Doesn't work.
My repository is connected over a specific port 8080. I gave ip-address in svn url as http://my-svn-pet-name:8080/...
Any help is highly appreciated.
UPDATE: To isolate the issue, i tried to connect http://gdata-objectivec-client.googlecode.com/svn/trunk/ from xcode organizer and it works without any problem. I didn't supply any user-name and password for this location. However, my repository requires authentication, in my recent tries when i select the short-cut on left pane, the dot-icon next to trunk, branches and tag glows green. However, when i click 'root' and tried to expand 'trunk' it says 'Unable to load revisions'
UPDATE 9/9/11: Uninstalled xcode using command sudo /Developer/Library/uninstall-devtools --mode=all and Restarted the mac and Re-installed Xcode 4.2.
When i open Organizer, contrary to my expectation, all svn shortcuts are intact and the issue still persists.
The problems are only with the latest XCode 4 (build 4C177 — iOS 5 beta 7).
A slightly earlier version of XCode 4 (build 4C104 — iOS 5 beta 5) works fine.
Like Saran, I tried the suggestions from majkelx and OMH and they did not work for me.
When I launch build 4C177, and immediately open the Organizer, the repositories initially show green (as Saran noted) and histories are available. Any other operation turns them red. But the comparison view in the text editor successfully shows diffs against the repository, with revision number.
So, I conclude that the repositories are set up OK and authentication is actually working, but various source-control functionality in build 4C177 is buggy. I'd advise installing an earlier XCode 4 and waiting for the next release. I filed a bug report with Apple.
Close Xcode and all of Subversion clients
Go to Keychain Access.app
Search for all 'svn' entries.
Delete all which can be related to your repository (assuming that you remember users and passes)
Checkout project from the command line (Terminal.app) (to be sure, I use svn which goes with Xcode in the example below, may be You have installed another svn command line from macports or sth?)
/Developer/usr/bin/svn co http://my-svn-pet-name:8080/... tmp-dir
Provide users and passes when svn asks for them.
Go to Keychain Access.app again and for newly created entry (search for svn again) in details/Access Control, give access to password for all apps (this's not needed in 99% of cases but can fix issues with svn versions and other subversion clients mismatches).
That's it. Xcode should see your repositories again, or after recreating shortcuts to them in Organiser.
Tried everything, "Host is unreachable" all the way.
The following fixed it instantly for ME (using a https connection(!)):
Enter your repo address in Safari (only server address might work, as well).
When Safari warns you about trusting the server, "always accept" the certificate.
Restart Xcode. Done. Works.
I have been having the same issues, starting with beta_7 (previous betas of 4.2 did not exhibit the issue). I upgraded to the GM of 4.2, and still the same.
I discovered what was happening in my situation. The URL endpoints I've been used are SSL (https://my-svn/etc/etc). When I logged in via Safari to test, I was being presented with the "cert might not be valid" warning, then I continued past this and was able to enter my creds and could see the repository structure (as expected).
I initially thought that the cert being used on the server had expired, and Xcode was honoring the warning behind the scenes. Next time I tried with Safari, I chose the "View Certificate" in the warning, and saw that the cert was still fresh (2018 expiration date), but that our self-signed cert was not pointing to a Certificate Authority, and Safari was reporting that my Mac did not trust that cert. So, I chose the "Always trust" options that are presented by the dialog, and the warnings went away in Safari. The "forced trust" is established in the Mac's Keychain, so then I launched Xcode and viola, all of the associated repository entries in Organizer glowed green.
I had the same problem using VisualSVN.
I could connect to is over HTTPS://mysvnserver:8443/ where I then was requested for a user/pass combo.
In Xcode the connection always failed. Sometimes Xcode would complain about the certificate not being issued by a trusted authority, which in my case would be correct.
The certificate is in my keychain as always trust but that didn't solve the issue.
My solution:
open an terminal window
type command svn co https://mysvnserver:8443
A request is issued for the certificate security press P to allow permanent.
Xcode 4.2's SVN is well and truly broken.
svn from the command line works just fine, so I don't see how it can be an authentication issue -- it's just a straight bug and a demonstration of how much testing Xcode releases receive these days... The Xcode 4 series has been a lot of backwards :-(
SVN in Xcode 4.1 was almost working properly.... And now it doesn't work at all. Whee!
Had the same problem. The dots are green in the list of repositories but it just refuses to commit changes or update status, though compare works fine.
I opened Repositories, then on the left pane selected the project under the repository item. In the bottom-left of the window you'll have two buttons, Update and Commit. I pressed Commit there and it worked fine. However, after that it still wouldn't commit through the project (Alt+Cmd+C or through File menu). Not sure exactly what's going on.
When you use any IP to access SVN, XCode sends local user's credentials and SVN cannot authorize user;
You just need to create an alias for your IP in hosts and use that alias in URL instead of IP. A comprehensive manual of how to make aliases you can find here. At the end my URL looked like http://svnserver:8080/svn/....
After upgrading to Xcode 4.2, I had the same problems, red dots, and "host unreachable".
I tried the recipe from majkelx, but those dots where still red.
But then I just tried to check out the repository with the Xcode organizer instead of the command line. And suddenly it all worked!
(It may not have worked without fiddling with the Keychain, like majkelx described)
EDIT: When searching for Subversion entries in keychain, also seach for "sub", not just "svn". My passwords where in "subversion". Only my web subversion password was in "svn".
Just one more hint for others who are struggling with this. I wasted more than an hour on this today. :-)
I have this same issue, with Xcode 4.2 (Build 4D199) being able to connect initially (green lights) then losing connection shortly after (red lights). But this only happens when I am connected to the same LAN as the SVN repository using a cable. If I switch to a wireless connection, Xcode is able to connect again (green lights). In all cases I am able to ping and connect to SVN using the terminal and other SVN tools. It is just Xcode that struggles. You could try going wireless or through VPN to bypass this problem.
Try remove the "https://login#" from your svn address
Works for me.
for http://my-svn-pet-name:8080/ try something like my-svn-pet-name:8080/

How to setup PC and Mac for using git

I use git both for Mac and PC.
When pulling Mac's git from PC, it's easy as I can use ssh.
git clone smcho#prosseek:~/smcho/setup
The problem happens the other way round : to pull from Mac. I guess there are two ways to go.
Method 1 : Connect to server
By using 'connect to server' in Mac, I can make PC's directory like that of Mac. Even though, the file permission issue, it works pretty well.
Method 2 : ssh
I could run cygwin ssh server (cygrunsrv -S sshd) to be accessed from other computers, but for me, I have to wait quite a while to get connection as I explained here. It's almost impossible for to use it with git, as I don't want to wait for minutes to get clone.
Here comes my question.
Is there any better way other than the previous two methods?
Is there a (natural) way to support ssh server from Windows (windows 7 precisely) not using cygwin?
I've started using the philosophy of trying to stick in the native environment that something is designed for.
With that in mind, my windows box has an ubuntu server virtual machine that hosts my git repositories. The nice thing is the linux + virtual box + git is an awesome source repository that is completely free. No extra machine and you can give it very little memory so it isn't a resource hog.
There is even another option:
If you use both computers for developing and just want to keep the repositories in sync, you could create a bare repository and use something like Dropbox to synchronize it.
I see two other solutions :
using a third synchronisation server: GitHub, the most famous (if your program is OpenSource), but you can also find free online private Git repositories
on Windows, you can set up the Git server ('git daemon' command). On MAC, you'll access to the Windows repository using the URL git://ip_of_windows_machine/repository/
You might consider another approach entirely. If you're using git as a revision control system that you might consider a hosted account for mastering your repository, maintaining backups, etc. http://github.com/ is the leader in the space for git.

Resources