我有一个启用了稀疏结帐的工作副本。我想做的git rebase -i。但是,如果我在变基时遇到冲突,所有从签出文件中排除的文件都标记为deleted和not staged for commit。
因此,当我确实解决实际冲突和所需文件时,由于未暂存的更改,git add我仍然无法完成。git rebase --continue我可以git checkout -f -- <excluded files>,但是很不方便。
git-rebase有没有更好的稀疏结账方法?
I have a git repository with a bunch of large csv in them, which I don't want to clone, so I came across git sparse-checkout and this post: https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/
From this post I took following:
git clone --no-checkout https://github.com/john_doe/repo-with-big-csv.git
cd repo-with-big-csv
git sparse-checkout init --cone
Run Code Online (Sandbox Code Playgroud)
Then I edit the .git/info/sparse-checkout and add the following (adapted from example in page above):
/*
!**/*.csv
Run Code Online (Sandbox Code Playgroud)
但它似乎不能正常工作。有些文件夹克隆后git pull,有些则没有。我还注意到一个警告,当我这样做时,git sparse-checkout list我得到:
warning: unrecognized pattern: '**/*.csv'
warning: disabling cone pattern matching
/* …Run Code Online (Sandbox Code Playgroud) 我想克隆一个包含巨大 .exe 文件的 GitHub 存储库。(为什么?!)我对 .exe 文件的使用为零,它比其他所有文件的总和还要大得多。克隆文件时有没有办法忽略该文件?
我的猜测是,我会更幸运地要求作者制作一个无 exe 的分支!希望有一些不错的方法可以解决这个问题。
假设我有两个具有特定模块(或子目录)的存储库,如下所示:
repo1/
/module1
/module2
/module3
repo2/
/module4
/module5
Run Code Online (Sandbox Code Playgroud)
因此,在我的测试服务器上,我按原样加载这些存储库,而且没问题,因为我获得了所有代码。但是在客户端服务器上,假设我只需要他的项目模块(假设是)repo2,而且还需要上一个项目的一个模块(即)repo1。
有没有一种方法可以让我从repo1only进行克隆module1,然后如果我要更新repo1中更改的任何内容module1,当我执行pullfor repo1(仅克隆部分存储库)时,它会更新它?
更新 所以在客户端服务器上会有两个像这样的存储库:
repo1/
/module1
repo2/
/module4
/module5
Run Code Online (Sandbox Code Playgroud) 有很多关于稀疏结账的文章和问题。不幸的是我没有找到具体的例子。我想让以下示例工作:
cd ~
mkdir sub && cd $_
git init
mkdir foo && touch $_/foo
mkdir bar && touch $_/bar
git add .
git commit -am "Initial commit"
Run Code Online (Sandbox Code Playgroud)
cd ~
mkdir project && cd $_
git init
git submodule add ../sub sub
git config -f .gitmodules submodule.sub.shallow true
git config -f .gitmodules submodule.sub.sparsecheckout true
echo foo/* > .git/modules/sub/info/sparse-checkout
git commit -am "Initial commit"
git submodule update
cd sub
git checkout .
Run Code Online (Sandbox Code Playgroud)
在这一点上,我希望sub文件夹只包含foo/foonot bar。不幸的是它不起作用: …