Skip to content

Instantly share code, notes, and snippets.

@SongFuZhen
Last active January 27, 2021 01:20
Show Gist options
  • Save SongFuZhen/b038be535aac32c53fac1bc3bb09f7e0 to your computer and use it in GitHub Desktop.
Save SongFuZhen/b038be535aac32c53fac1bc3bb09f7e0 to your computer and use it in GitHub Desktop.

方案二

查询地址: http://github.com.ipaddress.com/

查询地址如下:

52.216.115.19 github-cloud.s3.amazonaws.com
140.82.114.4 github.com
199.232.5.194 github.global.ssl.fastly.net

hosts 目录 C:\Windows\System32\drivers\etc

Tips: 为了保证正确,可以使用 http://ipaddress.com/ 查询到真正的ip地址

以上

Git 常用命令

git status

查看更改过的文件

git log

查看提交(commit)日志,可以找到日志id

git cherry-pick commint-id 单独合并一个提交

注意:当执行完 cherry-pick 以后,将会生成一个新的提交;这个新的提交的哈希值和原来的不同,但标识名一样;

使用 cherry-pick 可以单独合并一个 commit 操作到分支上

Github Auto packing the repository in background for optimum performance

git运行突然提示Auto packing the repository in background for optimum performance

查资料,原来是自己本地一些 “悬空对象”太多

git删除分支或者清空stash的时候,这些其实还没有真正删除,成为悬空对象,我们可以使用merge命令可以从中恢复一些文件

解决

  1. 输入命令:git fsck --lost-found, 可以看到好多dangling commit
  2. 清空他们:git gc --prune=now, 完成

github在国内访问很慢的解决方式

hosts文件中添加如下内容

192.30.253.113      github.com
151.101.185.194     github.global.ssl.fastly.net

hosts 目录 C:\Windows\System32\drivers\etc

Tips: 为了保证正确,可以使用 http://ipaddress.com/ 查询到真正的ip地址

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment