User Tools

Site Tools


work:git-config

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
work:git-config [2011/09/10 18:14] – external edit 127.0.0.1work:git-config [2016/05/05 13:07] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Windows上git的配置====== ====== Windows上git的配置======
 +
 在Windows上使用git需要一些特殊的配置. 在Windows上使用git需要一些特殊的配置.
 +  git config --global user.name "pjq"
 +  git config --global user.email "pengjianqing@gmail.com"
 +
  
 最近从github.com上clone代码,没做任何修改用git status查看状态,就会发现有些文件被自动修改了,但实际上我没有做任何修改. 最近从github.com上clone代码,没做任何修改用git status查看状态,就会发现有些文件被自动修改了,但实际上我没有做任何修改.
 +
 出现这个问题就是crlfd做怪了,需要用下面的命令将它转为false 出现这个问题就是crlfd做怪了,需要用下面的命令将它转为false
 +
   git config --global core.autocrlf false   git config --global core.autocrlf false
 +
      
 +
 如果要查看当前的配置: 如果要查看当前的配置:
 +
   git config -l   git config -l
 +
 <code> <code>
 +
 $ git config -l $ git config -l
 +
 core.symlinks=false core.symlinks=false
 +
 core.autocrlf=true core.autocrlf=true
 +
 color.diff=auto color.diff=auto
 +
 pack.packsizelimit=2g pack.packsizelimit=2g
 +
 help.format=html help.format=html
 +
 http.sslcainfo=/bin/curl-ca-bundle.crt http.sslcainfo=/bin/curl-ca-bundle.crt
 +
 sendemail.smtpserver=/bin/msmtp.exe sendemail.smtpserver=/bin/msmtp.exe
 +
 user.name=Percy Peng user.name=Percy Peng
 +
 user.email=Percy.Peng@qisda.com user.email=Percy.Peng@qisda.com
 +
 core.autocrlf=false core.autocrlf=false
 +
 </code> </code>
 +
 ====== 参考 ====== ====== 参考 ======
 +
 http://hi.baidu.com/d_life/blog/item/c5ef6e823a3b93b46c8119c5.html http://hi.baidu.com/d_life/blog/item/c5ef6e823a3b93b46c8119c5.html
 +
 +
 +
 +
  
  
  
 ====== Gentoo上git ====== ====== Gentoo上git ======
 +
 我需要在宿舍电脑上也能够clone代码,这就需要添加另外一个key了。 我需要在宿舍电脑上也能够clone代码,这就需要添加另外一个key了。
 +
 参考:http://help.github.com/linux-key-setup/ 参考:http://help.github.com/linux-key-setup/
 +
 之前如果已经存rsa的话,需要先记着备份。 之前如果已经存rsa的话,需要先记着备份。
 +
 +
  
 创建命令: 创建命令:
 +
   ssh-keygen -t rsa -C "pengjianqing@gmail.com"   ssh-keygen -t rsa -C "pengjianqing@gmail.com"
 +
 然后将id_rsa.pub添加到github帐户中去。 然后将id_rsa.pub添加到github帐户中去。
 +
 然后我想着这个时候应该可以clone了吧,试了下不行, 然后我想着这个时候应该可以clone了吧,试了下不行,
 +
   Cloning into DellStage...   Cloning into DellStage...
 +
   Agent admitted failure to sign using the key.   Agent admitted failure to sign using the key.
 +
   Permission denied (publickey).   Permission denied (publickey).
 +
   fatal: The remote end hung up unexpectedly   fatal: The remote end hung up unexpectedly
 +
 这个时候还需要将这个生成的key添加到系统中去, 这个时候还需要将这个生成的key添加到系统中去,
 +
   ssh-add id_rsa   ssh-add id_rsa
 +
 再clone一下,OK了。 再clone一下,OK了。
 +
 +
  
  
/var/www/dokuwiki/wiki/data/attic/work/git-config.1315649645.txt.gz · Last modified: 2016/05/05 13:06 (external edit)