Add existing Android Studio project to existing GitHub repository












0















I've created a project new project in Android Studio and I want to add it to an existing GitHub repository which is currently empty.



I have tried the answer from this question: Replace GitHub repository with a new Android Studio project while preserving old commits
but once I get to the final git push I get an error saying fatal: No configured push destination.



I have also tried https://github.community/t5/How-to-use-Git-and-GitHub/How-to-link-an-existing-Android-Studio-Project-to-an-existing/td-p/1946 but this uploads the project to the wrong GitHub account. I have two GitHub accounts which I think was the problem for this solution and I have since logged out of the account I don't need.



Are there any other ways to connect to an existing GitHub repository?










share|improve this question



























    0















    I've created a project new project in Android Studio and I want to add it to an existing GitHub repository which is currently empty.



    I have tried the answer from this question: Replace GitHub repository with a new Android Studio project while preserving old commits
    but once I get to the final git push I get an error saying fatal: No configured push destination.



    I have also tried https://github.community/t5/How-to-use-Git-and-GitHub/How-to-link-an-existing-Android-Studio-Project-to-an-existing/td-p/1946 but this uploads the project to the wrong GitHub account. I have two GitHub accounts which I think was the problem for this solution and I have since logged out of the account I don't need.



    Are there any other ways to connect to an existing GitHub repository?










    share|improve this question

























      0












      0








      0








      I've created a project new project in Android Studio and I want to add it to an existing GitHub repository which is currently empty.



      I have tried the answer from this question: Replace GitHub repository with a new Android Studio project while preserving old commits
      but once I get to the final git push I get an error saying fatal: No configured push destination.



      I have also tried https://github.community/t5/How-to-use-Git-and-GitHub/How-to-link-an-existing-Android-Studio-Project-to-an-existing/td-p/1946 but this uploads the project to the wrong GitHub account. I have two GitHub accounts which I think was the problem for this solution and I have since logged out of the account I don't need.



      Are there any other ways to connect to an existing GitHub repository?










      share|improve this question














      I've created a project new project in Android Studio and I want to add it to an existing GitHub repository which is currently empty.



      I have tried the answer from this question: Replace GitHub repository with a new Android Studio project while preserving old commits
      but once I get to the final git push I get an error saying fatal: No configured push destination.



      I have also tried https://github.community/t5/How-to-use-Git-and-GitHub/How-to-link-an-existing-Android-Studio-Project-to-an-existing/td-p/1946 but this uploads the project to the wrong GitHub account. I have two GitHub accounts which I think was the problem for this solution and I have since logged out of the account I don't need.



      Are there any other ways to connect to an existing GitHub repository?







      git android-studio github






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 '18 at 12:54









      Tori HarrisTori Harris

      748




      748
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Most probably you forgot to add a remote. you can check your list of remote using the following command.



          -> git remote -v



          if there exist no origin, try add a remote using:



          -> git remote add -remote name- -remote url-



          (remote url is your repository url, for example: https://github.com/user/repo.git)



          then you can push using the following command:



          git push -remote name- -your branch name-






          share|improve this answer

































            0














            The first thing you have to do is to create your local repository (on your machine)



            git init


            As you are trying to do a git push, I assume you already have done that.
            So the next thing you have to do is to define a remote repository (github) for your local repository to push on :



            git remote add origin https://github.com/<user>/<repo>.git


            You then can do your push but with a few more paramters.



            git push -u origin master


            That will tell git to push your commits to the master branch on your origin remote repository



            More information on git remote here : https://help.github.com/articles/adding-a-remote/






            share|improve this answer

























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431514%2fadd-existing-android-studio-project-to-existing-github-repository%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Most probably you forgot to add a remote. you can check your list of remote using the following command.



              -> git remote -v



              if there exist no origin, try add a remote using:



              -> git remote add -remote name- -remote url-



              (remote url is your repository url, for example: https://github.com/user/repo.git)



              then you can push using the following command:



              git push -remote name- -your branch name-






              share|improve this answer






























                1














                Most probably you forgot to add a remote. you can check your list of remote using the following command.



                -> git remote -v



                if there exist no origin, try add a remote using:



                -> git remote add -remote name- -remote url-



                (remote url is your repository url, for example: https://github.com/user/repo.git)



                then you can push using the following command:



                git push -remote name- -your branch name-






                share|improve this answer




























                  1












                  1








                  1







                  Most probably you forgot to add a remote. you can check your list of remote using the following command.



                  -> git remote -v



                  if there exist no origin, try add a remote using:



                  -> git remote add -remote name- -remote url-



                  (remote url is your repository url, for example: https://github.com/user/repo.git)



                  then you can push using the following command:



                  git push -remote name- -your branch name-






                  share|improve this answer















                  Most probably you forgot to add a remote. you can check your list of remote using the following command.



                  -> git remote -v



                  if there exist no origin, try add a remote using:



                  -> git remote add -remote name- -remote url-



                  (remote url is your repository url, for example: https://github.com/user/repo.git)



                  then you can push using the following command:



                  git push -remote name- -your branch name-







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 22 '18 at 14:47

























                  answered Nov 22 '18 at 13:09









                  Golam Rahman TusharGolam Rahman Tushar

                  686




                  686

























                      0














                      The first thing you have to do is to create your local repository (on your machine)



                      git init


                      As you are trying to do a git push, I assume you already have done that.
                      So the next thing you have to do is to define a remote repository (github) for your local repository to push on :



                      git remote add origin https://github.com/<user>/<repo>.git


                      You then can do your push but with a few more paramters.



                      git push -u origin master


                      That will tell git to push your commits to the master branch on your origin remote repository



                      More information on git remote here : https://help.github.com/articles/adding-a-remote/






                      share|improve this answer






























                        0














                        The first thing you have to do is to create your local repository (on your machine)



                        git init


                        As you are trying to do a git push, I assume you already have done that.
                        So the next thing you have to do is to define a remote repository (github) for your local repository to push on :



                        git remote add origin https://github.com/<user>/<repo>.git


                        You then can do your push but with a few more paramters.



                        git push -u origin master


                        That will tell git to push your commits to the master branch on your origin remote repository



                        More information on git remote here : https://help.github.com/articles/adding-a-remote/






                        share|improve this answer




























                          0












                          0








                          0







                          The first thing you have to do is to create your local repository (on your machine)



                          git init


                          As you are trying to do a git push, I assume you already have done that.
                          So the next thing you have to do is to define a remote repository (github) for your local repository to push on :



                          git remote add origin https://github.com/<user>/<repo>.git


                          You then can do your push but with a few more paramters.



                          git push -u origin master


                          That will tell git to push your commits to the master branch on your origin remote repository



                          More information on git remote here : https://help.github.com/articles/adding-a-remote/






                          share|improve this answer















                          The first thing you have to do is to create your local repository (on your machine)



                          git init


                          As you are trying to do a git push, I assume you already have done that.
                          So the next thing you have to do is to define a remote repository (github) for your local repository to push on :



                          git remote add origin https://github.com/<user>/<repo>.git


                          You then can do your push but with a few more paramters.



                          git push -u origin master


                          That will tell git to push your commits to the master branch on your origin remote repository



                          More information on git remote here : https://help.github.com/articles/adding-a-remote/







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Nov 22 '18 at 13:22

























                          answered Nov 22 '18 at 13:09









                          MuldecMuldec

                          4819




                          4819






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53431514%2fadd-existing-android-studio-project-to-existing-github-repository%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Feedback on college project

                              Futebolista

                              Albești (Vaslui)