简体   繁体   English

git克隆分叉git分支的特定版本

[英]git clone a specific release from a forked git branch

I want to clone a specific version of a forked git repository, but seem to be misunderstanding why I am getting what I am getting. 我想克隆一个特定版本的分叉git存储库,但似乎误解了为什么我得到了我得到的东西。
I want to pull v2.43.0 from https://github.com/giggls/openstreetmap-carto-de , 我想从https://github.com/giggls/openstreetmap-carto-de中提取v2.43.0,

1.) which in theory should also have "hstore-only.style" (but does not if you click on v2.43.0). 1.)理论上也应该有“hstore-only.style”(但如果点击v2.43.0则不会)。 It seems to have it only under master. 它似乎只在主人之下。 Why is that? 这是为什么?

2.) If I do 2.)如果我这样做

$ git clone git://github.com/giggls/openstreetmap-carto-de.git

This gives me the master, and I see all files including "hstore-only.style" 这给了我主人,我看到所有文件,包括“hstore-only.style”

$ cd openstreetmap-carto-de
$ git tag -l

this already gives me v2.9.1, which is confusing. 这已经给了我v2.9.1,这令人困惑。 Because there the highest tag is 2.43.0. 因为最高标签是2.43.0。 Where does the 2.9 come from? 2.9来自哪里?

3.) and with 3.)和

$ git checkout v2.43.0

I would get the reduced file set without hstore-only.style . 我会在没有hstore-only.style情况下获得减少的文件集。
Is there a way I can get the 2.43 with that file? 有没有办法用这个文件获得2.43?

I want to pull v2.43.0 from https://github.com/giggls/openstreetmap-carto-de , 我想从https://github.com/giggls/openstreetmap-carto-de中提取v2.43.0,

git clone --branch v2.43.0 --single-branch https://github.com/giggls/openstreetmap-carto-de

If the tag exists on the remote side (and it seems it does ), it will allow you to clone it locally. 如果标签存在于远程端(并且它似乎存在 ),它将允许您在本地克隆它。

You can add --depth 1 if you don't want the full history locally. 如果您不想在本地使用完整历史记录,可以添加--depth 1

A git describe --all will give you v2.43.0 一个git describe --all会给你v2.43.0

However, in that branch, there is no hstore-only.style . 但是,在该分支中,没有hstore-only.style

If I clone the full repo and do: 如果我克隆完整的回购并执行:

C:\Users\vonc\prog\git\openstreetmap-carto-de>git log --full-history --oneline --decorate -- hstore-only.style
8a386af Merge tag 'v3.1.0'
cbbe151 Merge tag 'v3.0.1'
30e20a5 Merge tag 'v3.0.0'
d876fbb Merge tag 'v2.45.1'
7dcf103 Merge tag 'v2.45.0'
ad8bd4f Merge tag 'v2.44.1' from upstream
8ac3f86 Merge upstream tag 'v2.44.0'

As you can see, that file was probably introduced in v2.44.0 and more, not yet in v2.43.0. 如您所见,该文件可能是在v2.44.0及更高版本中引入的,尚未在v2.43.0中引入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM