GIT fatal: unable to write new index file - macos

My Company (Web Development) has decided to use Git. All repositories: employee (local repo) and remote repositories (bare repo) are stored on the central development server (OS X 10.9.1, Mac mini middle 2011). Developer connect to the development server from their iMacs over local network (OS X 10.7.5, 10.8.1 and so on, only Macs) and write the source code there. A Git client on Mac called Sourcetree should do the whole work. But after a few commits or some other git operations I get sooner or later following message:
fatal: unable to write new index file
After the message GIT can track the changes in the project, but I can't save anything to git. Even by using terminal or anotrher GIT-GUIs (I have tried Coda, GitHub) I get the same error message.
If the git client and the repository are stored on the same mac, everything works fine (tried on the development server and two iMacs). The problem occurs only if the git client has to connect to the repository over local network (AFP).
If I start the Git client on the development server and save some changes to the „damaged“ repository, everything works again. Also over local network. But if i work then in the repository on the development server with my local git client from my iMac over local network, I get sooner or later (mostly after a few adds or commits) the same error message.
I connect or login on server allways as the same user. Also Git client connects as the same user.
I suspect, that the reason is AFP.
I have enouth free space on the central development server. And have enouth file permissions, at least initially. These topics were not helpful for me:
https://apple.stackexchange.com/questions/111934/git-not-working-over-afp
GIT: "fatal: unable to write new_index file" while commit
git problem : fatal: Unable to write new index file
https://answers.atlassian.com/questions/155102/sourcetree-error-fatal-unable-to-write-new-index-file
Does Git generally choke on mounted drives? Or just Git GUI's?
What could I do?

We've run into the same issue repeatedly, especially as we try to use XCode 6. I'm currently changing over my connect to our server to WebDAV (connecting to our server via Finder > Go (menubar) > Connect to Server... > https://localnetworkIP/userfolder/).
This is working for us (so far).
UPDATE: After a few days, I noticed a new issue using WebDAV: files would disappear from view in the Finder causing XCode/Git to think that the file had been deleted. Looking at the server showed that the files were still there.
I then changed my connection type to SMB. This has worked well for me: Git no longer encounters file permission errors, and Finder (OSX 10.10 Yosemite) doesn't "loose" files.

Related

SVN, new file commit failed using VPN

My company just installed a VPN. It works, we can access our intranet SVN server but it is impossible to commit a new file. Here is the error :
> svn commit -m "Sandbox test" .
Adding test.txt
Transmitting file data .svn: E120105: Commit failed (details follow):
svn: E120105: Error running context: The server sent an improper HTTP response
It occurs only when we commit a new file.
These following operations works well:
update
modify a file and commit
delete a file and commit
delete a directory and commit
add a directory and commit
show log
show repo-browser
We tested on several computer or user, connecting from home or from mobile network. Results are the same.
And all works fine without VPN (from company intranet).
We use TortoiseSVN v1.12.2 (i.e. Subversion v1.12.2) on Windows 10 and I just updated to TortoiseSVN v1.14.0 to test (no difference).
On the server side, SVN version is 1.8.19.
I read some post from people who had this kind of problem with SVN client v1.8 and resolve it with SVN client v1.9. Is it possible that the SVN server v1.8 has the same problem and we should upgrade it ?

Best working solution to develop one project on Xcode using two Mac, Synology NAS, Git and Bitbucket?

So far, I am developing using a MacMini. The code is automatically saved on the local SSD repository (localized inside CloudStation folder), then automatically copied on Synology NAS. Periodically I doing commits (git) and push them to Bitbucket.
Previous set-up:
- MacMini.
- Synology NAS.
- Private project repository on Bitbucket.
- Local project repository both on NAS and local SSD using CloudStation.
I recently bought a MacBook Pro and what to use both Mac.
I installed CloudStation and opened the source code from Synology folder. The problem is that it does not consider it as a Git repository.
As far as I understood, the git repository is the local folder on MacMini.
The one on Synology is simply a copy.
I would like to be able to code either on my MacMini, or on my MacBookPro as if I had only 1 Mac. Using Git, and pushing commits to Bitbucket.
What would be the best solution?
I think about 3 solutions:
1) Use only 1 repository localized on the NAS (with git) and access it directly (without CloudStation which is doing a copy). But this might be a problem if my local network/internet is not working, as I will not be able to access the folder. Also I may have problem if Xcode is open on both Mac at the same time...
2) Each Mac will have its own local repository (no CloudStation back-up copy, or in 2 different user CloudStation folders). When I work on one Mac, I then should commit and push to Bitbucket. Then I will be able to pull to the other Mac if need.
3) Install git server on the Synology NAS. Have local versions stored on both Mac and push/pull to/from the NAS. But will this replace Bitbucket? Can I still push to Bitbucket afterward?

Git how to access repository Windows local machine?

I installed Git for Windows in order to clone and pull a project hosted on a remote Linux server.
In my repository (D:/repositories/my-project) I launch the following commands
git clone server#192.168.56.101:/var/www/web/my-project/.git
git pull origin master
So far so good. I pull the project files whenever modifications are applied on the server.
But now I'd like to pull or push from the remote server to my local repository.
I tried many things but I can't figure out how to access the repository located on my local machine.
Things like:
git pull duddy#my-pc:/d/repositories/my-project/.git master
just doesn't work, Git says:
ssh: Could not resolve hostname my-pc: Name or service not known
fatal: Could not read from remote repository.
Can someone helps me ?
First things first, I would recommend you try simply running git pull.
If this doesn't work, try running git remote -v and check to make sure that the URL for your server is listed as an origin (server#192.168.56.101:/var/www/web/my-project/.git).
Your issue is that you are inputting the URL for your local repository in your attempt to git pull.
I suggest reading the git-pull documentation to learn more about how pull works.
Basically, you need to have some service at your workstation which serves the requests. There are following options (I did not try most of them myself, just making it up from what I know):
use the windows file access. This is the easiest to setup at the windows workstation - just share the repository folder. The Linux side should somehow be able to mount windows shares (like described, for example, here: https://wiki.ubuntu.com/MountWindowsSharesPermanently). If you manage to mount your \\my-pc\repo to some /mount/my-pc-repo, then you can access it as file:///mount/my-pc-repo.
run git daemon at windows. Set up instructions are available at SO (for example, https://stackoverflow.com/a/2275844/2303202) and it pretty straightforward, but it does not have any authentication and in most cases it is reasonable to use it only for reading, so you will not be able to push to the workstation, only fetch.
set up ssh daemon and access through ssh authentication with read-write access. Git for windows installation contains the needed software (the sshd.exe binary, it is there at least for Git for Windows 2.6.0), probably there is a way to utilize it but I could not find it quickly.
set up HTTP(S) service at your workstation. I don't know if it is possible to do only with Git for Windows (it might be, with some perl module which happen to be included with it), or you should use some other software.

Error creating git repos using Xcode/OS X Server

I recently installed OS X Server on a seperate machine and attempting to host some git repos. When I try to create a new project & remote repo with Xcode I get an error -
Could not connect to the remote repository because the server was unreachable.
If I attempt to configure it again after the project has been created I get this error -
Cannot create hosted Git repositories at path because path already exists: /Library/Developer/XcodeServer/HostedRepositories/SampleProject
Looking at the server - I can see the repos were actually created, but for some reason I can't connect/push to them. I have tried this on the machine running the server and another one on the same network with the same results. Is something not configured correctly or any way to get at a more detailed error?
Fixed it by going into the Xcode service repository settings and enabling SSH access.

Trouble connecting to my git repository from windows to linux

I have git installed on my local windows 7 PC. I can commit there.
I have git installed on my linux dev server. I can commit there.
I have successfully cloned to each machine a github repository. So they seem to be working in that sense. But I'd like to be able to push from my PC to the dev server.
I believe that I am missing a crucial piece of info here and can't find any tutorials, questions answered on how to set this up.
I have a few questions:
I was led to believe that I don't NEED to set up ssh keys to do this, I will just be prompted for a password.
My site was developed in php, is it possible to push to the linux server and have the live dev site continue running, with the new changes?
Here is how I'm currently trying to clone from my linux server and the response... (i changed the IP address)
C:\DevEnv>git clone 0.0.0.0:gitrepo.git
Cloning into 'gitrepo'...
fatal: The remote end hung up unexpectedly
I have a directory called gitrepo.git that has a repository.
I also tried creating a repository in the home dir of mysite.com. When I try cloning that from my PC this is what happens:
C:\DevEnv>git clone http://mysite.com
Cloning into 'mysite.com'...
fatal: http://mysite.com/info/refs not valid: is this a git repository?
I've read through many tutorials and they mostly talk about either really really basic concepts, or how to push/pull to github, or just skip over certain settings so when I follow them I get fatal: The remote end hung up unexpectedly...
Any help, point in the right direction would be most appreciated!
You may need to provide your username. For example:
$ git clone myusername#myhost.com:/opt/git/project.git
Or you could setup a samba-share on the Linux box and share your git-repo, mount the share in windows and clone it from the filesystem.
More info about setting up git on a server:
http://progit.org/book/ch4-0.html
Check path to your project.
Try to clon via git protocol:
C:\DevEnv>git clone git://0.0.0.0/gitrepo.git

Resources