2

I am working on Android studio and i wanted to push my android project to an organisation's repository but whenever i commit the changes it uploads the project to my username directory and not the Organisation's repository. Please explain me by taking this example- my username-abc organisation name-xyz repository name-123 so i want to upload my project to https://github.com/xyz/123

ColdFire
  • 6,466
  • 6
  • 33
  • 50
Bond 007
  • 421
  • 4
  • 16

1 Answers1

8

Create a new repository under your organization's account, then add it as a new remote:

git remote add newRemote https://github.com/organization/repo.git

Then, push using this command:

git push newRemote master

If you wish to make the organization's repo the default repo, you must replace the remote called origin:

git remote rm origin
git remote add origin https://github.com/organization/repo.git

You can list all currently configured remotes like so:

git remote -v
vatbub
  • 2,128
  • 15
  • 33