Disable git EOL Conversions -


Edit: Re-written for relevance

Unfortunately, for any operation, it seems that there is no point in doing this. I have reduced it in the following test case, to which many different ways to disable this behavior, There are different mechanisms that I could get. Edit: Most accurate commands added.


  • Start with two machines (Windows Computer = A, Linux Computer = B)
  • On both machines: Git config --global core
  • On both machines:
    • Create a new repository from an empty folder at:
      • git init --shared (then created .git directory)
      • Create a new file .gitignore in the repository
      • In a repository with a new file .gitattributes : * -text
      • git add
      • git branch master_recv , then git commit -m "initial commit" Li> Add a remote
      • Create a new file document
      • Command: git add-A , then < Code> git commit -m "& lt; some more gt;" .txt
      • Keep in mind that A's document.txt is still CRLF (and it's deleting and - hard Reset with still returns the version with the CRLF)
      • SCP B
      • Add a new file from the computer to the full directory Containing CRLF
      • Command: git add-A , then git commit -m "
      • Note that both the document.txt and the new code of B are still included in the CRL < / Ul>
        • Drag A Master: git pull & lt; Remote & gt; Master: Master_recv
        • A has changed to document.txt LF. Added file new file includes LF.

          The problem does not occur if B is a Windows machine.

          Within your project, there should be a .gitattributes file. Most of the time, it should look like this:

          Change * text = auto by * text = false

          like this:

          If your project does not have a .gitattributes file, then the line end is determined by your GIT configuration. To change your GIT configuration, do this:

          Go to the config file in this directory:

          1) C: \ Programmatic \ Git \ config \ / p>

          2) Open the config file in Notepad ++ (or whatever text editor you like)

          3) Change "autocrlf =" to false.



Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -