基于提交id从git获取代码

基于提交id从git获取代码,git,bitbucket,Git,Bitbucket,我正在使用git和bitbucket。请指导我如何下载或提取基于提交id的所有代码。 例如,提交ID是“1”、“2”、“3”,我想要“1”和“2”中的加载代码 请帮忙 如果我没弄错的话,非常感谢。进行初始克隆时: git clone ssh://git@bitbucket.org:username/reponame.git -b commit_id 当您已经克隆了存储库时: git fetch # fetches all new commits from re

我正在使用git和bitbucket。请指导我如何下载或提取基于提交id的所有代码。 例如,提交ID是“1”、“2”、“3”,我想要“1”和“2”中的加载代码

请帮忙


如果我没弄错的话,非常感谢。进行初始克隆时:

git clone ssh://git@bitbucket.org:username/reponame.git -b commit_id
当您已经克隆了存储库时:

git fetch                  # fetches all new commits from remote
git checkout commit_id     # changes current HEAD to desired commit
或者,如果您只需要下载代码(无git历史记录):

注意最后一个,如果这个回购协议是私有的,您需要为wget指定授权。要在授权的情况下使用wget:

wget --http-user=username --http-password=password https://bitbucket.org/username/reponame/get/commit_id.zip

如果我没弄错的话。进行初始克隆时:

git clone ssh://git@bitbucket.org:username/reponame.git -b commit_id
当您已经克隆了存储库时:

git fetch                  # fetches all new commits from remote
git checkout commit_id     # changes current HEAD to desired commit
或者,如果您只需要下载代码(无git历史记录):

注意最后一个,如果这个回购协议是私有的,您需要为wget指定授权。要在授权的情况下使用wget:

wget --http-user=username --http-password=password https://bitbucket.org/username/reponame/get/commit_id.zip