gitを使用して特定のブランチを取得します

gitを使用して特定のブランチを取得します

次のウェブサイトからソースコードをダウンロードしたいと思います。マスター - 次のブランチで説明されているようにgitを使用してください。シリンシッキー

私はこれを試しました:

#git clone git://github.com/Xilinx/u-boot-xlnx/tree/master-next.git

Initialized empty Git repository in /home/Hannan/master-next/.git/
fatal: remote error:
Xilinx/u-boot-xlnx/tree/master-next is not a valid repository name
Email [email protected] for help

これも失敗します。

# git clone git://github.com/Xilinx/tree/master-next/u-boot-xlnx.git
Initialized empty Git repository in /home/Hannan/u-boot-xlnx/.git/
fatal: remote error:
Xilinx/tree/master-next/u-boot-xlnx is not a valid repository name
Email [email protected] for help

有効なコマンドは次のとおりです。

 git clone git://github.com/Xilinx/u-boot-xlnx.git

しかし、これが実際にインポートされるかどうかはどうすればわかりますか?マスター - 次のブランチ代わりにマスターブランチ? gitを使用して特定のブランチを正しくインポートする方法は?

私はPuTTYを介してアクセスされるRHEL 6を使用しています。

ベストアンサー1

エラーメッセージが示すように、git clonegitリポジトリが必要です。このように、パスに分岐名を「追加」することはできません。バラよりgitのブランチ

単一のブランチ(およびその履歴)を複製できます。 git clone <url> --branch <branch> --single-branch

望むよりgit help clone

ただし、実行するレプリケーションコマンドはリポジトリ全体のコピーを提供し、それを使用して既存のブランチgit branchとその詳細を表示できますgit show-branch

目的の場所にスイッチを使用してくださいgit checkout branch-name

本の1枚Gitのプロフェッショナルバージョン本(オンラインで利用可能)は、基本的なコマンドの詳細を提供します。

おすすめ記事