How can I check to see which repo project is connected when I'm using android studio
?
I have created a new repo in bitbucket
, pulled that new repository and copied the old project which was connected to another repository to that folder now I want to make sure that I will push to the right repository.
You can inspect a Git repository by using the git status command. This command allows you to see which changes have been staged, which haven't, and which files aren't being tracked by Git. You should try and remember that status output does not show you any information regarding the committed project history.
" git ls-remote " is the quickest way I know to test communications with a remote repository without actually cloning it. Hence its utility as a test for this issue. You can see it used for detecting an address issue in " git ls-remote returns 128 on any repo".
You should be able to view your remote repositories by clicking VCS > Git > Remotes.
In Android Studio you can also click the Console tab to bring up a terminal. If you have set up remote repositories, git remote -v
will list them, along with their names.
To make sure you push to the right repository, just make sure you use the right repository name from this list when doing so.
Your output might be as simple as
origin https://github.com/username/myrepo (fetch)
origin https://github.com/username/myrepo (push)
in which case git push origin master
would push to the master branch of myrepo
.
If you have multiple remote repositories it might look like
origin https://github.com/username/myrepo (fetch)
origin https://github.com/username/myrepo (push)
repo2 https://github.com/username2/anotherrepo (fetch)
repo2 https://github.com/username2/anotherrepo (push)
in which case you can use origin
or repo2
in your push command depending on where you want to commit your changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With