windows,git,gitattributes,core.autocrlf , Override .gitattributes text=auto in Windows


Override .gitattributes text=auto in Windows

Question:

Tag: windows,git,gitattributes,core.autocrlf

This is pretty unintuitive:

C:\python-tdl\examples\termbox>git config core.autocrlf
false

C:\python-tdl\examples\termbox>git commit termbox.py
warning: LF will be replaced by CRLF in examples/termbox/termbox.py.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in examples/termbox/termbox.py.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in examples/termbox/termbox.py.
The file will have its original line endings in your working directory.
Aborting commit due to empty commit message.

According to various media with core.autocrlf=false there should be no linefeed conversion at all.

In project root I discovered .gitattributes with the line:

# Auto detect text files and perform LF normalization
* text=auto

If I comment it, the warning goes away. The question - how can I override this .gitattibutes setting automatically?


Answer:

.gitattributes overrides all config settings, so it really can't be overridden; it is the "overrider," so to speak. While you can simply remove the line, this will cause inconsistent behavior on other developers' machines if they have core.autocrlf=true. So the best bet would be to add the following line to .gitattributes: * -text. This will disable CRLF processing for all files.


Related:


I rewrote my program and need some suggestions for my git repo


git
My program has gone through a rewrite. I have done all the work in a separate git repo but I want to it all back to the original. Is there a good way to do this so that it is obvious that this a new rewrite? Something like rename master...

sys.argv in a windows environment


python,windows,python-3.x
I'm attempting to learn python using the book 'a byte of python'. The code: import sys print('the command line arguments are:') for i in sys.argv: print(i) print('\n\nThe PYTHONPATH is', sys.path, '\n') outputs: the command line arguments are: C:/Users/user/PycharmProjects/helloWorld/module_using_sys.py The PYTHONPATH is ['C:\\Users\\user\\PycharmProjects\\helloWorld', 'C:\\Users\\user\\PycharmProjects\\helloWorld', 'C:\\Python34\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages']...

Would using Vagrant be overkill? [on hold]


python,windows,ubuntu,vagrant,virtualbox
I'm a developer-hobbyist running Windows 8.1 on a Yoga 2 Pro. I mostly do Python/Django work but I think I'm gonna pick up Ruby soon. The thing is, Windows always seems to be the limiting factor for any project I want to pick up. Last time I tried to install...

Parsing the text file line-by-line using batch script (batch file)


windows,batch-file,scripting,cmd
So, I am programming in the batch script and I came across this issue. The following code will take yourwords.txt file and parse it. The existedWord variable will have the last word of the text file. So, everytime when I run this program it will only compare the user's input...

Write Access for user on all repos on Gitolite


git,ubuntu,gitolite
I'm trying to add access to read, write and create new repos from my local to a gitolite server. I have the following config on my gitolite server, but it doesn't want to let me push to a new repo: repo @all RW+ = git repo gitolite-admin RW+ = git...

Apache - finding configuration file path


windows,apache,server
I have to migrate another apache instance from 2.2 to 2.4 but I have one problem. In Apache monitor I see multiple services running but I don't really know where apache .conf files are stored. In previous migrations from 2.2 to 2.4 I had them somewhere within conf folder. Apache...

Why does rebasing unset my current branch and does not complete?


git,rebase
I'm on branch b4 and do "$ git rebase master", it gives me conflicts. $ git rebase master First, rewinding head to replay your work on top of it... Applying: rebase: Modified 1.txt Using index info to reconstruct a base tree... M 1.txt Falling back to patching base and 3-way...

Why can I view some Unix executable files in Mac OS X and not others?


git,bash,shell,unix,binary
I am on a Macbook Pro on Mac OS X 10.10 (Yosemite). When I go to /usr/bin, git is there as a unix executable file. When I open it up in Sublime Text, all I get is unreadable machine code. However, when I open up a different Unix executable file—in...

Why does Windows Server 2008 think Italy should be in W. European Time?


java,windows,timezone
Why does MS Windows (specifically server 2008 here) consider Italy to be in W. European Time when (I think) it should be in Central European Time according to every other source I can find? TZUtil /g gives: W. Europe Standard Time The control panel shows: (UTC+01:00) Amsterdam, Berlin, Bern, Rome,...

How to tell git-svn that files are NOT binary


git,svn,migration,git-svn,gitattributes
I am converting a large SVN-repo (~28k Commits) into Git using git-svn. When the process was through (~ 1 1/2 weeks) I encountered some .ps1-files being treated as binary in the diffs. I have commited a .gitignore file on master (after the conversion of course) that tells git to treat...

Execute a batch file before executing in a shortcut (.lnk)


windows,batch-file,lnk
I have multiple versions of a program called Siemens NX. NX uses environmental variables for configuration. I need NX 10.0 to use a different set of environmental variables than my NX 7.5 which uses the system environmental variables. Therefore, I have written a batch file that setups the environmental variables...

UAC error while installing Xampp 1.8.35 on windows 8


windows,xampp,localhost
I am trying to install xampp but before installation it gives me the following error: I have disabled UAC and it gives me this error.When I press ok and install the thing anyway it still won't let start apache and my sql up. Also installation was done in Program file...

“Arguments to path.resolve must be strings” when calling 'gitbook build' from a Git hook


node.js,git,gruntjs,githooks,gitbook
I am trying to run gitbook build within a post-receive Git hook on my (Gitlab, Debian 7, virtual private) server. Basically I want to: checkout the bare repository to a temporary dir run gitbook build in that temporary dir sync with the webspace through rsync The post-receive script runs something...

Is it possible to connect to remote DB while working in localhost?


php,mysql,git,phpmyadmin
I am working on a project with my developers on localhost. We are using git to collaborate but are having issues collaborating the database using git or using a remote db. Is there any possible way where I can use git or set up a remote server while working with...

Trying to understand git upstream branch


git,github,version-control
I have a git project. The remote only have a master branch, at local I have a master and proj-structure branch. I created the proj-structure branch using 'git branch -b proj-structure'. I am currently at proj-structure branch at local, when I try to git push, the git suggests me to...

git: assume unchanged bit not set


git
I have a file in my repo for which I tried setting the assume unchanged bit but it's still showing up in my unstaged file list. When I list all files for which the assumed unchanged bit is set, I get no files. Below are the steps I did. /tmp/GitIssue...

bat file script to check if string contains other string


windows,batch-file,cmd
I need to write a batch file that will check if a variable contains specific value. I tried to do the following: If "%%a"=="%%a:%pattern%" ( echo Yes ) else ( echo No ) input example: %%a="bob binson" %patern%="binson" I never get Yes printed! can anyone please tell what i missed...

How do I view the list of commits that haven't been pushed yet?


git,git-bash
I like documenting minor changes as separate commits and finally use git interactive --rebase to combine commits and change commit messages like I deem appropriate. Is there a way to determine which commits I haven't pushed yet without manually checking Github i.e. is there a way to find out from...

Unable to edit netbeans.conf


java,windows,netbeans
I am trying to modify 'netbeans.conf' located at following path: C:\Program Files\NetBeans 8.0.2\etc When i modify the file; add -J-Dfile.encoding=UTF-8 In Notepad, it is not allowing me to save the original file. In Notepad++, it says 'please echeck if this file is opened in another program'. Netbeans is installed in...

Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?


windows,sockets,winsock,winsock2
I'm developing a server-client application using WinSock. Does using the same WSAOVERLAPPED with both WSASend and WSARecv works well? Should I use different WSAOVERLAPPED struct for WSASend and WSARecv?...

Custom post-receive hook with gitlab


git,gitlab,webhooks
I am trying to set up a custom post-receive hook using gitlab I am following their documentation here I have an executable post-receive file in the custom_hooks folder with the following code: !/bin/bash echo "post-receive firing | wall git pull If I run this file with: ./post-receive It works fine....

I cannot use the msg command in cmd (or batch for that matter). How can I fix this?


windows,batch-file
While in cmd or making a batch file, I cannot use the command msg. When I try to use it, it returns the error msg is not recognized as an internal or external command, operable program or batch file." I'm pretty sure the error is that im missing a msg.exe...

How to get rid of .ignore file in Git?


git,file,bitbucket,ignore
I have create an ignore file , the list included .jar files . I then merged my branch to a development branch and even though I had resolved all my conflicts , I still had a lot of errors. Most of them had something to do with support.v4 (the import...

What is the max length of a share path in windows?


c#,windows
As I read in the MSDN site, for example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. But when I was created a share with a long path (more than 100 symbols) they trim...

Can git ever send your code to a repo that isn't yours?


git,github,git-commit,git-add,git-init
Can running git add . git commit -m "message" in a git repo which you've initialized using git init ever result in your code being sent to a repo that is not yours? I am concerned because I did this while not logged in to my git hub account....

Override .gitattributes text=auto in Windows


windows,git,gitattributes,core.autocrlf
This is pretty unintuitive: C:\python-tdl\examples\termbox>git config core.autocrlf false C:\python-tdl\examples\termbox>git commit termbox.py warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in examples/termbox/termbox.py. The file will have its original line endings in...

Cannot get my post-commit script to run (git)


git,hook
I want my remote git-repo to create a zip file from one folder in the master branch every time someone pushes. I renamed the post-commit.sample file and added the following: #!/bin/bash echo "creating zip" /usr/local/bin/git archive --format=zip --output=~/the-folder.zip master:the-folder echo "creating zip done" When I commit from my client I...

Why doesn't “go get gopkg.in/…” work while “go get github.com/…” OK?


windows,git,powershell,github,go
I try to use go get gopkg.in/fatih/pool.v2 to install pool according to Readme.md, but can't success: C:\Users\xiaona\Documents\GitHub> go get -v gopkg.in/fatih/pool.v2 Fetching https://gopkg.in/fatih/pool.v2?go-get=1 https fetch failed. Fetching http://gopkg.in/fatih/pool.v2?go-get=1 import "gopkg.in/fatih/pool.v2": http/https fetch: Get http://gopkg.in/fatih/poo l.v2?go-get=1: dial tcp 107.178.216.236:80: ConnectEx tcp: A connection attempt failed because the connected party did not...

Composer package not found in private repository


git,composer-php
I'm using Composer to load my private remote repository from BitBucket: { "require": { "pico/pico-core": "dev-dev" }, "repositories": [ { "type": "git", "url": "https://[email protected]/picodevelopmentteam/php-server-core.git" } ], "autoload": { "psr-0": { "PicoApi\\": "" } }, "minimum-stability": "dev" } My pico-core composer.json looks like this: { "name": "pico/pico-core", "require": { "facebook/php-sdk": "@stable",...

Contributing to open source project on github


git,github
I want to add translation and a bugfix on open source project on github. I had installed git, forked the project, cloned the fork on my harddrive, changed the permissions of the file(needed to do so I can test the changes), then created a new branch called "Bulgarian_language", then added...

Configure Git to use a .pem key from a specific location


git,ssh
Whenever I try to do a 'git pull origin master' I get (It is NOT Github): Permission denied (publickey). I am able to SSH into my AWS EC2 Linux sever, which has the bare repository, which I'm trying to pull from when I get the aforementioned permission error. I have...

Getting code from my forked repository


git,laravel,repository,laravel-5,composer-php
I made a fork from a repository called "chrisbjr/api-guard". the repository latest version is v2.2.2, and I made a release v2.2.3 from my fork. I have my own branch which is dev-fulluth, to get the code from my fork not from the main repo, composer has to contain the below...

Java read bytes from Socket on Linux


linux,windows,sockets,network-programming,raspberry-pi
I'm trying to send a file from my Windows machine to my Raspberry-Pi 2, and I have a client and a server. The client should be able to send a zip file over the network to my server on my linux machine. I know my client and server work on...

How to undo a successful “git cherry-pick”?


git
On a local repo, I've just exected git cherry-pick SHA without any conflicts or problems. I then realized I didn't want to do what I just did. I have not pushed this anywhere. How can I remove just this cherry pick? I'd like to know if there's a way to...

How to pull files and only override conflicts


git,github
How can I pull down a git and have it overwrite my local project ONLY where conflicts are found? E.g. I have many folders / files in my local project that are not on the git project and never will be. Ok... here is the full scenario. I used DaftMonk...

Managing git repos


git,github
I am new to git and am unsure of a few things, would really appreciate if someone could answer the below questions. So I own 2 private git repos. Repo1 has numerous developers contributing. Repo2 is only for me. I want to be able to basically take a copy Repo1,...

Extended description text on Git


git,bitbucket
I want commit with message and Extended description text to Bitbucket server. It exists on Git-cola software and I need the command line of it. I am using ubuntu and I need terminal command for Extended description git commit -am "My commit text" "My Extended description is this. Containing break...

How can I get the last commit in all tags?


git
I've just made a commit in my project, and I was creating a tag in every step, but it seems the last commit was done in some of this tags. The thing is that I can not longer see my latest change from a minutes ago. How can I checkout...

Go back before commit and push changes


git
In my local environment I made several changes, then: $ git log --oneline 2aa8998 Changes 02 5131bfe Changes 01 $ git commit -am "Commit 03" $ git push $ git log --oneline 9ca6c56 Changes 03 2aa8998 Changes 02 5131bfe Changes 01 But I noticed what I made a mistake, as...

Is there a way to push to a remote Git repository without having to fetch its objects?


git
Let's say I have a large Git repository stored in a server so multiple people can work with it. I want to be able to work with individual files from this repository, i.e. read, edit or insert new ones, without having to fetch all its contents, since it's a considerably...

Application is missing required files


c#,.net,windows,winforms,sharpdevelop
Pic of Error: http://s23.postimg.org/7uj6qcxtn/9708083373e57a9ec91e4296e302f88e.png Cannot Download the Application. The Application is missing required Files. Contact Application Vendor For Assistance. So I'm building a windows form application using SharpDevelop 5.2 and I'm trying to make a standalone/version someone else would be able to use on another machine. In sharpdevelop (and visual...

choose authentication for git pull


git,github
I want to add a second form of authentication to a github remote. Here is the situation : I have ssh access to a shared server In the server, there is a git repository, with a github remote. If I run git pull, it asks for a passphrase that I...

How to set the classpath in Windows Command Line correctly


java,windows,command-line,classnotfoundexception
I have made many attempts to enter a command to run a JAR file correctly from the terminal, and I am 100% sure that all the JAR files and such are in the given paths, but I keep getting a ClassDefNotFoundException. Does it have anything to do with the way...

Pull request within one project/branch?


git,github
Suppose C(=Coder) and S(=Supervisor) are working on a project. For some reasons S never contributes to the codes and just comments on the code. Instead C is the only person coding. Is it possible to send pull request by C to be reviewed by S, within one project, or they...

Fix git branch after another developer did a reset


git,github
We 2 developers are working on a branch. I did 2 commits, and pushed them, and we later decided we didn't want them anymore. I did git reset -i <sha> to the sha before the 2 commits, and then force pushed it to the branch on github. The other developer...

String manipulation with batch scripting


windows,string,batch-file,space
I need to save the variable in %%c temporarily which comes from a for loop. But when I try to do that, the content changes unexpectedly. Some space characters appear at the end of the string. The content of %%c is a.jpg by the way. echo %%ca REM prints a.jpga...

String parsing with batch scripting


windows,string,parsing,batch-file,xml-parsing
I have a file called pictures.xml and it contains some pictures information like: <ResourcePicture Name="a.jpg"> <GeneratedPicture Name="b.jpg"/> <GeneratedPicture Name="c.jpg"/> </ResourcePicture> <ResourcePicture Name="z1.jpg"> <GeneratedPicture Name="z2.jpg"/> <GeneratedPicture Name="z3.jpg"/> <GeneratedPicture Name="z4.jpg"/> </ResourcePicture> What I want do do is to get each line in for loop and print the names of the pictures. Sample...

How to send Ctrl+S through SendKeys.Send() method to save a file(save as dialog)


c#,.net,windows,sendkeys
I need to save a file which is in an External application using SendKeys.Send() method. The keys needed to be sent are Ctrl+S. I wrote the below code, but its not working: SendKeys.SendWait("^%s?"); // to get the Save As dialog Thread.Sleep(5000); SetForegroundWindow(FindWindow(null, "Save As")); Thread.Sleep(5000); SendKeys.SendWait("xyz"); // Sending FileName ...