Search code examples
githubrepositorybackup

Backup github repository, branches and commits?


I want to backup everything including master & other branches & commits on my local & create new repository using different account.

Which steps should i follow ? (bundle, mirror or clone)


Solution

  • To backup your local, one of the following is enough

    Option 1. Just copy the project folder to a new place.

    Option 2

    1. Copy the hidden .git/ folder to a new_project_folder.
    2. Run git checkout master in that folder.

    Option 3

    1. Create a new_project_folder.
    2. `cd path/to/new_project_folder

    Now, you need to push to a remote repository. Do it just as you did with previous repo, but use new credentials.

    • with GitHub gui tool
    • with git remote add ...