gitが複製するときに理解しやすいようにリモートリポジトリの名前を変更する方法[重複]

gitが複製するときに理解しやすいようにリモートリポジトリの名前を変更する方法[重複]

一般的に理解しやすく名前を変更する方法は次のとおりです。

$ git clone <remote URL.git>
$ mv remotedir nameIwant 

これを行うより良い方法があるかどうか疑問に思います。

その理由は、時々フォークを試してメインストアを維持したいからです。オリジナルなので、フォークの名前も原産地によって変わりました。リポジトリの~/.git/configからリモートパスを取得できることを知っていますが、これは覚えやすいです。

もっと良い方法がありますか?

オンラインで検索しましたが、役に立つものが見つかりませんでした。

ベストアンサー1

コマンドの後に目的の宛先ディレクトリ名を指定してみてください。たとえば、次のようになります。

git clone <remote URL.git> nameIwant

からman git-clone

<directory>
    The name of a new directory to clone into. The "humanish" part of
    the source repository is used if no directory is explicitly given
    (repo for /path/to/repo.git and foo for host.xz:foo/.git). Cloning
    into an existing directory is only allowed if the directory is
    empty.

おすすめ記事