6 月 082015
 

1.git clone 报错

Initialized empty Git repository in /home/git/myuni/.git/
error: The requested URL returned error: 401 Unauthorized while accessing http://git.zhihuishu.com/coder/myuni.git/info/refs

fatal: HTTP request failed

升级git即可

rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

yum –enablerepo=rpmforge-extras install git

 

2.git 保存密码

  1. 解决“Git Windows或Linux客户端保存用户名与密码”的问题
    在linux系统下如果没有名为“.netrc”的文件,直接创建一个即可:touch .netrc(命令)
    .netrc文件内容示例

    1
    machine nb.tooqe.com

    2
    login linmaogan

    3
    password 123456

    最后再设置文件访问权限:

    1
    chmod 600 ~/.netrc

    在Windows系统中的设置方法:
    1.对“我的电脑->右键->属性->高级->环境变量->Administrator 的用户变量->新建” 在Windows中添加一个HOME环境变量,值为%USERPROFILE%,如下图:

    2. 在“开始》运行”中打开%Home%,新建一个名为“_netrc”的文件。

    3. 用记事本打开_netrc文件,输入Git服务器名、用户名、密码,并保存。示例如下:

    machine git.cnblogs.com
    login cnblogs_user
    password cnblogs_pwd

 

3.git的大小写问题

我用tortoisegit 测试文件上传的时候遇到个奇怪的问题,就是在修改文件的大小的时候,无法生效。譬如:

客户端是小写的:

image

服务器上还是原来的:

image

后来发现只能先删掉提交下,然后再上传在提交才能解决问题。

同时测试发现,在linux下是没这个问题的,可能是因为Windows不区分大小写造成的:

image

image

所以用Windows 时一定要小心啊。

 Posted by at 下午 4:46  Tagged with:

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny