#author("2024-03-30T22:28:37+08:00","default:Admin","Admin")
#author("2025-03-14T13:22:40+08:00","default:Admin","Admin")
[[FrontPage]]

#contents

* よく使われているコマンド: [#j80ae0b4]

** チェックアウト [#h4d3ac88]

 git clone git://github.com/jquery/jquery.git

clone 中断调用 fetch 可断点续传(需要进入项目文件夹后,执行此命令)

 git fetch  --recurse-submodules
** 本地代码未修改,只有master分支,直接更新 [#b6815730]

 git pull

** 查看版本 [#f7dc2c24]

 git describe --tags --dirty

** 查看项目地址 [#m079d0c7]

 git remote -v

** 下载工程里的一些子工程 [#bc3f51ca]

下载后,再cd到目录中执行下面的命令

 git submodule update --init -f

末尾的 -f 表示强制执行

**“git commit”和“git push”的区别 [#hfdc3433]

git commit是"记录对存储库的更改",是将本地修改过的文件提交到本地库中;而git push是"更新远程引用和相关对象",是将本地库中的最新信息发送给远程库。


* Troubleshooting [#l350b818]

** error: unable to create file xxxxx.xx : Filename too long [#e4e121db]

 git config core.longpaths true
 git config --system core.longpaths true #需要管理员权限

设置core.longpaths这个配置项为true。

原因:

This error does not come for the UNIX or mac users. So they can push the long length file names to git but the issues occur only for the windows users. Because this capability is disabled by default in the Windows operating system.

使用下面的命令,可以看到返回 false 或者是 空 (看起来貌似没有反应)

 git config --get core.longpaths

** error: The following untracked working tree files would be overwritten by checkout [#uf509859]

 git clean -d -fx
** Cloning into 'D:/chip/third_party/editline'... fatal: unable to access 'https://github.com/editline.git/': OpenSSL SSL_read: Connection was reset, errno 10054 [#q3a8afa4]

网络差导致的此类问题

cd 到 git clone的主目录下,执行下述命令即可。

 git submodule update --init --recursive

* Tips [#h7a4c424]

- [[+Git+概要]]
- [[+Git+remote_Unauthorized]]

|Github	问题场景|解决办法|重要命令|h
|使用VPN时|调整Git代理设置|git config --global http.proxy, git config --global https.proxy|
|未使用VPN时|取消Git代理设置|git config --global --unset http.proxy, git config --global --unset https.proxy|


#hr();
コメント:
#comment_kcaptcha

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS