I've recently installed a vagrant VM on my windows box running ubuntu 14.04 for development purposes. I moved an existing Git project and placed this in the (synced) /vagrant folder so that I can get to my code from windows.
When I wanted to do my first commit, I saw that all files were modified. After googling for a bit I saw that this can be solved using:
git config core.filemode false
This made most of the changed files disappear, however some are still changed. After checking these files it seems that there's somehow a different line ending.
To solve it, I first tried:
git checkout .
But this had no effect whatsoever so I started searching again and found:
git config core.autocrlf true|false|input
git config core.eol lf
I tried each of these combinations followed by a git checkout . and git status but it keeps saying that my files are modified.
Does anyone of you know a solution to this (quite annoying) issue?
Related
Indeed I have same issue which is mentioned here "Why does bash (from git installation) give me segmentation fault suddenly?
"
My git was working properly. But I need to regenerate keygen value and I got segmentation fault. I remoted git and installed the latest version of git (2.19.0-64-bit). I tried with git-bash from search, bash.exe from bin folder , git.exe from bin folder , git-bash.exe under Git Folder and git-cmd.exe under Git folder. The results are same.
After I read the link I shared above , I checked the windows updates as well. But there is no update.
Is there any idea ? Thanks in advance
2.9 is not the latest, one: 2.19 is.
Try (for testing) and uncompress the latest Git for Windows portable archive PortableGit-2.19.0-64-bit.7z.exe anywhere you want.
Then setup a simplified path in a CMD session.
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
set GIT_HOME=C:\Path\to\Git
set PATH=%GIT_HOME%;%GIT_HOME%\bin;%GIT_HOME%\usr\bin;%GIT_HOME%\mingw64\bin;%PATH%
(Add any other path you would need)
Try then to regenerate your SSH key.
Also, make sure this is not related to an AV (Anti-Virus) as in issue 1832 or issue 1291.
My company also uses TrendMicro.
Can confirm that making an exception for /Git/usr/bin/bash.exe works as well.
For me it was C:\Program Files\Git\usr\bin, but adding it to the list of trusted programs did indeed fix the issue
I faced the same problem yesterday. Using git-bash, all my commands (i.e. mvn, javac, git pull) were giving error "Segmentation fault". This was because an update of my machine anti-virus which blocks proper access to my local login profile (sambit-swain#TERMINAL) After un-installing it, everything went back to normal.
So, the problem is not with GIT BASH or any other configuration. I should have checked the access levels (including SSH keys) to programs.
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
I have been having line endings issues on bash scripts for several months. I have another, slightly older Macbook Pro which can run the same scripts without issue.
This has been happening for numerous scripts with different contents written by different people, in different folders. It has affected every script I have attempted to run for the past three months. They have come from Github repos that contain mostly Drupal projects that I've collaborated on with a variety of other developers, none of whom experienced this problem and who were unable to reproduce it with their versions of the scripts. I did not download them as zipped files. I always clone them. They are private repos that I can't link here.
I thought maybe it was related to my .bash_profile settings so I tried changing them to match those of my other machine, which didn't have any effect. I then tried removing all .bash_profile and .bashrc files completely (after backing them up). Again, no effect.
This question is not about how to change line endings, which is covered in similar questions. It is about how to figure out why all the line endings on scripts on my machine are different to those on my other machine and all my coworkers' machines.
This is a systemic problem affecting my whole computer and I'm looking for a a solution more permanent than editing an individual script. The bash version is GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12).
Quick summary: You have core.autocrlf = true in your git configuration.
I've created a small public repo that you should be able to use to reproduce the problem:
git clone git#github.com:Keith-S-Thompson/hello.bash.git
This repo contains a 2-line shell script that should simply print hello on standard output. I expect that when you try it, it will print
bash: ./hello.bash: /bin/bash^M: bad interpreter: No such file or directory
on stderr.
I ran the following command to produce this symptom:
git config --local --add core.autocrlf true
I used --local so it would affect only my local copy of this repo, but you probably have something like:
[core]
autocrlf = true
in your $HOME/.gitconfig file (or it might be some related option).
You can also use
git config --list
to list your current configuration, including both local and global settings.
Remove the autocrlf = true line. (You can also update your configuration using the git config command; run git config --help for details.) Once you've verified that it fixes the problem for the hello.bash repo, re-clone your other repos.
Change the new line char. On a normal *nix box you fix this with dos2unix but, according to Google, on osx you need to do:
cat scriptname | col -b > scriptname2
I am running ubuntu 12 VM using virtual box on my mac. I have cloned a git repo in a shared folder on my mac. From that folder, in my ubuntu VM, i am creating a intellij project. Trouble is, when i create that project it marks all the files as changed with no change in contents(possibly due to different line ending). How can this be avoided? I have this configuration in .gitconfig on my mac and ubuntu vm autocrlf = input.
Can someone suggest the solution?
Check that you are using git on host machine and then try to set core.autocrlf to false:
git config --global core.autocrlf false
Reset all 'changes' to head with:
git reset --hard HEAD
Also check that your git has disabled handling for filemode changes
git config --list
Should be
core.filemode=false
If not, then set it with:
git config --global core.filemode false
The easiest was is to desactive that setting:
git config --auto auto.crlf false
(on your mac)
If your IDE (here IntelliJ) doesn't change the line endings, there is no need to impose a global settings changing all the files.
If some files have to keep a specific line ending, use core.eol directive in a .gitattributes file (which isn't a local config, but a file part of your repo, and as such, pushed and pulled as the other files).
See "How line ending conversions work with git core.autocrlf between different operating systems".
When I try to push new file into Git repository, it doesn't finish, on screen is my workflow:
I tried:
TortoiseGit 1.8.1.0 (git version 1.8.0.msysgit.0 (C:\Program
Files\Git\bin))
Eclipse EGit 2.1.0
Command line
without any success. I read this question, but it's quite old (1.5 year), and do not help (I installed git 1.7.4), and was the same. I new in Git, please tell me what am I doing wrong or how to solve it? What do you suggest as a Git client for Windows 7 (32)? (Best if it will support command line).
Pushing over the Git-protocol is still broken in Git for Windows. So if that's what you're attempting, check if you can push over another protocol instead.
I had this problem today. I pulled and then tried to push to the remote, and it got to 100% writing objects and just stayed there. It didn't request the repo password, nothing.
The solution was related to my .gitconfig file. I had to redo the settings in this file.
I think in mucking around with my git repository (and admittedly learning how git works by breaking it) I had inadvertently removed this file.