Github-Q & A Troubleshooting Common Mistakes (continually updated)

Q1: "remote origin already exists" when prompted to submit Git?

  Associate local and online warehouse of time, this error may occur because of the existing warehouse has been associated. This problem can be solved by the following method. Then you can re-associate.

git remote add origin

Q2: About git prompt "warning: LF will be replaced by CRLF" Ultimate Answers

  Solution author: acridine Dian Sun

  Case 1: If you're a Windows programmer, and is developing a project run only on Windows, you can set false to cancel this function, the carriage remains in the repository:

#提交检出均不转换
$ git config --global core.autocrlf false

  Case 2: Git automatically the carriage return (CR) and line feed (LF) converted into a line feed (LF) at the time you commit, and when the detected code is the line feed (LF) is converted into a carriage return (CR) and line feed ( LF). You can use the git config --global core.autocrlf true to turn on this feature. If you are on a Windows system, set it to true, so that when detecting code, line will be converted into a carriage return and linefeed:

#提交时转换为LF,检出时转换为CRLF
$ git config --global core.autocrlf true

  Case 3: If you use to wrap (LF) as a line terminator Linux or Mac, you do not need Git automatically converted when checking documents. However, when a carriage return (CR) and line feed (LF) as a line terminator file was accidentally introduced, you definitely want Git correction. So you can put core.autocrlf set input to tell Git when submitting converted into a carriage return and line wrap, so no conversion is detected :( check out files on Windows will retain the carriage return and line, and on Mac and Linux, as well as the repository will retain line breaks):

#提交时转换为LF,检出时不转换
$ git config --global core.autocrlf input

Guess you like

Origin www.cnblogs.com/levylovepage/p/11469003.html