CBF*_*BFT 16 python git source-control installation
我正在尝试使用 git-filter-repo 从我的存储库中删除大型二进制文件。我以前没有使用过python。我通过单击下载的 .exe 文件安装了最新的 python,因为这是 git-filter-repo 的要求。指令说:
git-filter-repo 是一个单文件 python 脚本,它是为了使基本使用的安装变得简单:只需将它复制到您的 $PATH 中
https://github.com/newren/git-filter-repo/#how-do-i-install-it
我试过用 python 应用程序打开 git-filter-repo.py。我也不能在 python 应用程序中使用 cd、ls 或 dir。
Cir*_*郝海东 16
pip install
他们现在有一个可以正常工作的python包:
python3 -m pip install --user git-filter-repo
Run Code Online (Sandbox Code Playgroud)
该方法会安装命令行可执行文件和 Python 库,您可以使用该库,如下所示。
可执行文件名为git-filter-repo
,Git 会在调用之类的调用中自动选取任何PATH
带有名称的可执行文件,这就是它的工作原理。git-*
git *
或者,如果由于某种原因您不想使用 pip,您也可以:
# Add to bashrc.
export PATH="${HOME}/bin:${PATH}"
mkdir -p ~/bin
wget -O ~/bin/git-filter-repo https://raw.githubusercontent.com/newren/git-filter-repo/7b3e714b94a6e5b9f478cb981c7f560ef3f36506/git-filter-repo
chmod +x ~/bin/git-filter-repo
Run Code Online (Sandbox Code Playgroud)
在 Ubuntu 20.04 上测试,git-filter-repo ac039ecc095d。
这就是我让它工作的方式。
归档时间: |
|
查看次数: |
7423 次 |
最近记录: |