默认情况下,git bash 中的中文路径是乱码的,例如创建一个名字为你好的文件,显示内容为:

如需解决这个问题,需要手动添加设置:
|
1 |
git config --global core.quotepath false |
以 github.com 为例,在 git 配置中在 git 配置中加上:
|
1 |
默认情况下,git bash 中的中文路径是乱码的,例如创建一个名字为你好的文件,显示内容为:

如需解决这个问题,需要手动添加设置:
|
1 |
git config --global core.quotepath false |
通过 git reset 和 git checkout 进行版本回退之后再次 git pull 抛出以下错误:
|
1 2 3 4 5 |
You are not currently on a branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> |
意思是当前的版本已经不在 master 分支了,解决的办法: git status 查看所有变化的文件,把有改动的先删除。 git chec ... 阅读更多
习惯了 svn 的 svn co,觉得 git checkout 不方便遂通过 git 的 alias 把 checkout 重命名为 co 。 这个操作以前一直都是相安无事,今天在一台新机器上运行时遇到以下问题:
|
1 2 3 4 |
> git co fatal: cannot exec 'git-co': Permission denied > git ss # ss = status -s fatal: cannot exec 'git-ss': Permission denied |
网上找了半天没有找到解决方案,并且发现不使用 ... 阅读更多
问题的原因是因为编译时系统缺少 curl 组件,根据系统安装: ubuntu: apt-get install curl libcurl3 libcurl4-openssl-dev centos: yum install curl-devel 然后重新编译安装 git: [crayon-695b861ad ... 阅读更多
github 属于境外网站,大部分时候访问速度都不到 100K,克隆大仓库时相当耗时。比较好的解决办法就是通过科学上网来进行代理,加快访问速度。 注:本文不提供科学上网的方式,只提供 git 设置代理的方式。 设置方法
|
1 2 3 4 5 6 7 |
# 设置代理 git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080' # 取消代理 git config --global --unset http.proxy git config --global --unset https.proxy |
或者 [crayon- ... 阅读更多
0x01 问题描述 使用 git mv 重命名文件时出现以下错误信息:
|
1 |
fatal: bad source, source=go/src/handle/add.go, destination=go/src/handle/add.go |
0x02 问题原因 源文件 go/src/handle/add.go 在本地已经被删除了,但是 git 库中并没有被删除,所以重命名该文件的上级目录时产生了冲突。 通过 ... 阅读更多
问题描述 github 每次 push 代码,都要输入密码,很麻烦。 这是因为 clone 的时候是用的 https 地址,导致 push 的时候默认也是 https 方式,所以每次都要输入密码。改成 ssh 方式就不用每次都输入密码了。 在终端中输入 git remote -v 可以看到远程连接方式: [crayon-695b ... 阅读更多
一、创建本地仓库并提交代码 git init 初始化一个新仓库。 git add git commit 把文件提交到本地仓库。 二、拉取远程仓库 先使用 git remote add 命令添加一个远程仓库,仓库地址:https://github.com/madawang/vazd 。 [crayon-695b ... 阅读更多
一、创建 github 仓库 点击浏览器右上角的+号,选择 New repository 开始创建一个仓库: 进入创建仓库页面,设置仓库的名字,下面可以选择自动创建一个 README.MD 文件: 创建成功后会跳转到仓库首页,点击 Clone or download 会出现该仓库的地址,浏览器当前地址栏中的地址也是 ... 阅读更多