LeTadas
LeTadas

Reputation: 3556

Git how to check to which repo project is connected

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.

Upvotes: 11

Views: 43073

Answers (1)

samwalton
samwalton

Reputation: 551

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.

Upvotes: 22

Related Questions