문제

Let's say that I have an open source project, and it has four versions, 1.0, 1.1, 1.2, and 2.0, available from my website in tar.gz files which do not include any version control system's data.

Can I create a repository on GitHub that reflects the four versions above and preserves the numbering so that someone who has seen the software on my website and wants 1.1 (or tip) can easily pull it from GitHub?

도움이 되었습니까?

해결책

Create Tagged Git Archives from Existing Tarballs

Yes and no. Git doesn't track revisions internally the way you think it does, but you can certainly use tags to create archives that match your current tarballs. For example:

git init

# Unpack version 1.0
tar xvfz /tmp/foo.tar.gz
git add .
git commit -m 'Add version 1.0'
git tag v1.0

# Remove files with GNU find before unpacking next archive.
find . -name .git -prune -o -exec rm {} +

You could then do the same, in order, for your other archived versions. Skip the find command when you're done adding versions. Then, when you push your tags to GitHub, each tag becomes available as a Git archive using the name of the tags you've created.

다른 팁

You can use git tags, one for each release. The basics can be found here. People can then decide whether to pull down the entire repo, or just a single tag.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top