[关闭]
@marlin 2016-08-13T05:01:46.000000Z 字数 1756 阅读 1389

Git 使用小技巧

git


  1. git clone https://github.com/shakiba/svgexport.git
  1. #将所有修改内容添加到提交列表
  2. git add -A
  1. git commit -m "提交时添加的注释"
  1. git push
  1. #在本地使用git rm命令删除该文件
  2. git rm fileName.del
  3. #之后就是commit+push
  4. git commit -m "删除"
  5. git push
  1. #使用add命令将本地变更添加到暂存区
  2. git add -u
  3. #之后使用commit+push
  4. git commit -m "删除"
  5. git push
  1. git status
  1. ssh: connect to host github.com port 22: Connection timed out

此时主要是由于windows重启后禁用了22端口(查资料+个人猜测),解决方法:

  1. git config --local -e
  2. #change entry of
  3. # url = git@github.com:username/repo.git
  4. #to
  5. # url = https://github.com/username/repo.git

这种解决方法在提交时会弹出登陆框,由于git已经使用ssh-keygen -t rsa -C "bianxu5555@126.com"再进行登陆有点不舒服,可以采用如下方法:

  1. #在~/.ssh/config文件中添加如下内容:
  2. Host github.com
  3. User bianxu5555@126.com
  4. HostName ssh.github.com
  5. PreferredAuthentications publickey
  6. IdentityFile ~/.ssh/id_rsa
  7. Port 443

通过指定端口,不再使用22端口。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注