Add existing Android Studio project to existing GitHub repository











up vote
0
down vote

favorite












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


























    up vote
    0
    down vote

    favorite












    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
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      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 at 12:54









      Tori Harris

      648




      648
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          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






























            up vote
            0
            down vote













            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',
              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








              up vote
              1
              down vote













              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



























                up vote
                1
                down vote













                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

























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  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 at 14:47

























                  answered Nov 22 at 13:09









                  Golam Rahman Tushar

                  646




                  646
























                      up vote
                      0
                      down vote













                      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



























                        up vote
                        0
                        down vote













                        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

























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          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 at 13:22

























                          answered Nov 22 at 13:09









                          Muldec

                          3698




                          3698






























                              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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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

                              Contact image not getting when fetch all contact list from iPhone by CNContact

                              count number of partitions of a set with n elements into k subsets

                              A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks