Cygwin failing to open .git/config - windows

I believe that I am missing something obvious.
I am using Windows 8.1 in VMWare Fusion on a Mac OS X host. I have installed Git as a Windows component, and I also installed Git as a Cygwin component.
I was able to use all my usual Git commands on Cygwin within a versioned directory. However, when I tried to push, I was notified that I have not yet associated my e-mail or name (git config --global user.name <name>; git config --global user.email <email address>).
When I ran those commands, I got a permission denied. Afterward, I was unable to issue ANY git command (status; show; pull; fetch; etc...).
I received the following error in Cygwin:
fatal: permission denied opening .git/config
UPDATE: I seemed to have resolved this by deleting my Cygwin C:\cygwin64\home\<user>\.gitconfig file. Any idea what may have been going on?
I believe that there is an issue when a .gitconfig is in the Cygwin home directory and there's a config file in the actual C:\Users\<user>\.git\ folder.
Am I missing something?

I seemed to have resolved this by deleting my Cygwin C:\cygwin64\home\.gitconfig file.

Related

git prompting for username and password

I recently upgraded git and apparently broke something. Now, whenever git tries to interact with my server (Bitbucket) I'm getting an error message and prompted for username and password. EVERY time.
Here's the error I'm getting:
git: 'credential-manager-core' is not a git command. See 'git --help'.
I have my git config set for user.name and user.email (this all worked before the upgrade), but I believe this error is blocking git from putting my credentials into the Credential Manager. I presume I have a bad config file somewhere but haven't been able to find it.
Turns out credential-manager-core.exe was missing from the git bin folder. I ended up uninstalling Git, manually clearing out the folders and then reinstalling.
Thanks everyone for the suggestions, got me looking in the right direction!

GIT Issue on Windows (The filename or extension is too long)

Overview:
Just installed the GIT version 2.20.1-64-bit on my Windows 7 platform. Git works well on GIT Bash; but, any git command on Windows CMD or Powershell raises The filename or extension is too long error.
Details:
GIT version: 2.20.1-64-bit
Platform: Windows 7
Troubleshooting Efforts:
I tried switching longpaths attribute to true based on Filename too long in Git for Windows. I also googled to find other solutions but all recommended the same approach which was updating the git config.
The GIT config file updated with git config --system core.longpaths true
Issue:
Any Git command via Windows CMD or 3rd party apps like IntelliJ Idea raises the following error:
CMD:
IntelliJ:
Please advise me with your genuine solutions.
I had the same problem. I then installed it in my user folder and now it works. It seems to be a privilege issue. Git gets installed as admin in C:\Program Files\Git but then can't write to these files because it is run as a user.
Also using the portable version should fix the problem.
Try first to use a simplified PATH and a portable Git (like PortableGit-2.20.1-64-bit.7z.exe) uncompressed anywhere you want.
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
Then check if the issue persists in that CMD session, where you have set said simplified PATH.

Git config values clash

I ran into big git configuration problem on my windows laptop. I downloaded Git for Desktop since I wasn't able to install git lfs to my cygwin git. I then removed the git from cygwin. I have a GitHub project which is using git-lfs for storing
large files. When I clone the project and it starts downloading files from the remote server it says:
WARNING: These git config values clash:
git config "http.sslcainfo" = "C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt"
git config "http.sslcainfo" = "/ssl/certs/ca-bundle-ghfw.crt"
Neither of those file locations exist on my computer. When I use git config --list I can see both values for http.sslcainfo. But the mingw one is not listed in with any of the git config --system --list, git config --global --list or git config --local --list. So I can't locate the file where
configuration is. I assume the Git for Desktop wants to use the /ssl/certs/ location since it sets it to git config --system when it is installed. I also have installed mingw on my computer but I couldn't find .gitconfig file inside it. Also I don't know why git would even look from there or where the configurations might be saved. I'm able to clone repository which doesn't use git-lfs. So is there any way to remove the http.sslcainfo = "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt" configuration? Any help will be highly appreciated.
first of all, i have to tell you that im not sure if i can help you. However, i want to share my information with you.... maybe it helps. I am tying out git-lfs for some big repos at the moment. I am using the bitbucket test server. Atleast on bitbucket, they say that files from git lfs are downloaded via HTTPS and need an ssl cert.
I hope that this helps you a bit. If you got more questions about this, feel free to ask.
Frossy

Gitolite on Windows - cloning stuck

I have installed gitolite on windows server using cygwin, installation steps went without problems and when I try to "ssh gitadmin#gitserver info" from local machine(windows) I get the correct response:
hello gitoliteAdmin, this is gitadmin#VRGWLSDEV1T running gitolite3 v3.6.1-6-gdc
8b590 on git 1.9.4.msysgit.0
R W gitolite-admin
R W testing
If I try to clone using Git Bash I get error:
$ git clone gitadmin#gitserver:gitolite-admin
Cloning into 'gitolite-admin'...
git: 'shell' is not a git command. See 'git --help'.
Did you mean this?
help
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If I try to clone using cygwin terminal on local mashine (using the same ssh key and I get the same valid gitolite message) it returns:
$ git clone gitadmin#gitserver:gitolite-admin.git
Cloning into 'gitolite-admin'...
...and stays like that for enternity!
I have searched for multiple solutions, added PATH (with Git etc.) to .bashrc and .bash_profile files on gitolite designated server. Also added PATH to .gitolite.rc to include custom Git installation path (before that I did not recieve the gitolite message)
If you have any solution or idea what did I do wrong: please....HELP.
Resolved it by myself:
Mysis Git installation was confusing Cygwin. Added Git pack to Cygwin and removed Msys Git env. variables: everything woks perfectly now.

Git fails initial push to new repo on network drive

Can you help me understand why my simple startup project is not working? I am using Windows XP, with Git installed from Git-1.8.1.2-preview20130201.exe. I am using Git Bash provided with the installation.
On the networked drive I do the following:
cd /k/repos
mkdir LV_Libraries.git
cd LV_Libraries.git
git init --bare
At my local copy of the project:
git init
git add *
git commit -m "Initial Commit"
git remote add origin /k/repos/LV_Libraries.git
git push origin master
The push fails saying,
"remote: error: unable to write sha1 filename ./objects/pack/pack-b69cd03c4c ... .pak: Permission denied"
"Remote: fatal: cannot store pack file"
"Error: unpack failed: index-pack abnormal exit"
"To k:/repos/LV_Libraries.git
! [remote rejected] master -> master (unpacker error)"
I initially thought it might be a file permissions thing, but I have no problems writing or reading files to the network drive through my terminal. Does anyone have any ideas?
Sounds like you are having problems similar to this question git: can't push (unpacker error) related to permission issues, i.e. permission problems on the k: disk, possibly related to user permissions.
Have you checked the exact permissions that you have on the UNC path for folder on K:?
I encountered this issue when attempting to push changes from a Windows machine via a Samba share hosted on a Mac OS X machine. I resolved this by initializing a SSH server on the Mac OS X machine and then cloning the project again via SSH on the Windows machine. Hence, all subsequent pushes from the Windows machine have worked beautifully without any errors.
When I checked out the project, via the Git GUI for Windows, I used the following syntax for the repository:
ssh://username#machost_ip:full_path_to_project
The username was the username used to create the project, the machost_ip was the IP address of my Mac OS X machine on my LAN, and the full_path_to_project was the fully qualified Unix path to the origin/master Git project.
I did not have success with the continued use of the shared drive even after changing group permissions. Although, I'm sure the username could be that of a user assigned to the group with write privileges to the project as specified in previous answers.
I deleted my git repository and then recreated it with
git init --bare --shared
and this solved the problem for me. Other answers mention setting config for shared and bare, but I found that only recreating the repository helped.
Have are your CRLF settings?
When playing around with the settings, I managed to generate a change that caused an problem identical to yours. In the end, I create a new clone of the remote repo and slowly merged my changes back to it.
I encountered same error yesterday. I am simply trying to clone one Big Git repository to my local windows machine using Git Bash 2.9.2.
After killing significant amount of time and reading above answers. I ran Git Bash as administrator and it worked like a charm. I am able to clone repository. Not sure what is the issue, I guess it is most probably related to permissions as many pointed.

Resources