Reputation: 1930
I have tried to configure android studio with git and messed up.
How to completely remove old git that I could create new one?
Upvotes: 23
Views: 37131
Reputation: 693
For me, the better solucion using Android Studio with Flutter projects was:
Upvotes: 0
Reputation: 5947
You can remove GIT from your Android Studio Project in File → Settings → Version Control → In VCS select and Apply.
Then you can add it back in VSC Menu → Enable Version Control Integration → Select GIT → OK button.
Upvotes: 9
Reputation: 34195
Remove and add git
//progect_path is path where .git is located
cd <progect_path>
rm -fr .git
git init
Upvotes: 0
Reputation: 70
In Android Studio terminal in your project dir: Windows:
rd /s /q ".git"
Linux/Mac:
rm -rf .git
Upvotes: 3
Reputation: 31
If you delete a git repository from github, you should also delete a folder name .git from your Android Studio root directory.
Then you have to close the project. And re-open it in Android Studio.
Then do these things: 1) VCS -> Enable Version Control Integration -> Git 2) In Project view in Android Studio, select the project root folder and right click on it. Then go to Git -> Add, after that Git -> Commit Directory, and then Git -> Repository -> Push .
Whenever you get prompts in this way, just click on appropriate options.
Upvotes: 2
Reputation: 1
Remove the git folder in Project directory
Run this command git init
in Terminal
Vcs=> Git=>remote and add new
Paste the new git URL
After, verify your GitHub credentials
Now new git attached to your project
Upvotes: 0
Reputation: 651
I find the top answer little bit too complicated, although fully functional. So here is maybe little bit easier to understand practice:
Assuming you already have project, and you want to change target (Bitbucket in my case) directory.
cd Your/project/location
git remote
(its name will be probably origin
)git remote remove yourOldRemoteName
git remote
(should display nothing)git remote add yourNewRemoteName repositoryUrl
(If you are using Bitbucket, your url will be something like https://[email protected]/your-company/yourRepository.git
and you will find it by clicking Clone
button in source folder of your repository or when creating the repository.)
Hope this will be useful!
Upvotes: 2
Reputation: 617
Just a simple way
Open the terminal in android studio.
git remote set-url origin <NEW GIT URL>
now the project url is changed from old link to new one. Then you can use >
git init
and upload your files. Happy coding :)
Upvotes: 8
Reputation: 6476
In order to drop the current git repository and create a new one you need to:
Go to the project's directory: cd PROJECT_DIRECTORY
Remove all the git specific files: rm -rf $(find . -name ".git*")
Initialize a new git repository: git init
This doesn't remove your project's files, only git configs
Upvotes: 43
Reputation: 1061
Delete the .git folder & .gitignore and start again.
Google for how to display hidden folders on windows to see the .git folder.
Upvotes: 3