How do I rename a Git repository created with gitolite?

后端 未结 4 1075
暗喜
暗喜 2021-01-30 02:50

I created a Git repository using gitolite. Now I would like to rename that repository.

How can I do this?

In gitolite\'s readme is says that I should not work d

4条回答
  •  梦谈多话
    2021-01-30 03:29

    A clean approach is to create the new repository as an empty one, then do the following:

    Assuming old is OLD and new (empty) is NEW:

    # mkdir /tmp/1
    # cd /tmp/1
    # git clone OLD_REPO old
    # git clone NEW_REPO new
    # cd new
    # git pull ../old
    # git push origin master
    

    Or you can use directly the remote repo for OLD:

    # mkdir /tmp/1
    # cd /tmp/1
    # git clone NEW_REPO new
    # cd new
    # git pull OLD_REPO
    # git push origin master
    

    This will keep all history and will let gitolite handle its internals. Additionally you'll have to update gitolite-admin but there's not limitation in the order.

    This also works remotely without problems.

    Deleting the OLD repository should be done per gitolite's instructions (locally) though.

提交回复
热议问题