Following are a very simple instructions on how to create a duplicate of your GitHub repository using Android Studio.
If your existing GitHub project (the one you want to duplicate in GitHub) is not yet imported into Android Studio, follow the steps for importing, otherwise skip to steps for duplicating the project.
IMPORT EXISTING GITHUB PROJECT TO ANDROID STUDIO
- Go to Android Studio and go to Menu / VCS / Checkout from Version Control / Git
- Paste the HTTPS path you obtained from GitHub and click on [Clone]
- Provide your GitHub username and password.
- Now the project should be imported to Android Studio and you should be able to commit and push future changes back to GitHub.
DUPLICATE EXISTING GITHUB PROJECT
-
Make sure Android Studio is closed
-
Open Windows Explorer and navigate to: C:..\YourProjectName.git
- Open the /.git/config file and delete the lines:
[remote "origin"]
url = https://github.com/GitHubAccount/YourProjectName.git
fetch = +refs/heads/*:refs/remotes/origin/*
- Now open Android Studio and 'Share Project on GitHub', this is where you'll find the option:
Then select a new name under which you'd like to share the project on Github:
Press Share and you're done, you've effectively created a GitHub duplicate of your original repository.
Note: there are a lot easier ways of doing the same thing directly from the git console.