GitHub - completely messed up the local files of gitHub in my computer












7















I created a repo in the wrong folder. Meaning the User folder in OS where all the user folders are from pics, videos to documents. So I pushed that all to gitHub without knowing and now I can't create a repo anymore because the files that I work with are in the documents folder, which is inside the User Folder. And it will imply that I'm creating a repo within a repo. So when I go to terminal and I run git status, it shows me this:



# On branch master
# Your branch and 'origin/master' have diverged,
# and have 2 and 4 different commits each, respectively.
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: Documents/m3/m3---Best-Game-Ever
# deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.h
# deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.h
# deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.h
# deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.h
# deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.h
# deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.h
# deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.cpp
# deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.h
# deleted: README.md
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .Trash/
# .bash_history
# .dropbox/
# .openmdao/
# .ssh/
# Documents/2nd_semester/
# Documents/Arduino/
# Documents/OpenMDAO/
# Documents/Personal/
# Documents/T.A/
# Documents/gitHub/
# Documents/mySite/
# Documents/openFrameworks/
# Documents/resources/
# Documents/webcam-pulse-detector-master/
# Dropbox/
# Library/
# Music/
no changes added to commit (use "git add" and/or "git commit -a")


Needless to say I'm never able to pull anything. It says that everything is up to date. At certain point I had a repo that uploaded those folders without the files to gitHub but I deleted that.



Any suggestions?










share|improve this question













migrated from stackoverflow.com May 24 '13 at 0:23


This question came from our site for professional and enthusiast programmers.























    7















    I created a repo in the wrong folder. Meaning the User folder in OS where all the user folders are from pics, videos to documents. So I pushed that all to gitHub without knowing and now I can't create a repo anymore because the files that I work with are in the documents folder, which is inside the User Folder. And it will imply that I'm creating a repo within a repo. So when I go to terminal and I run git status, it shows me this:



    # On branch master
    # Your branch and 'origin/master' have diverged,
    # and have 2 and 4 different commits each, respectively.
    #
    # Changes not staged for commit:
    # (use "git add/rm <file>..." to update what will be committed)
    # (use "git checkout -- <file>..." to discard changes in working directory)
    #
    # deleted: Documents/m3/m3---Best-Game-Ever
    # deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.h
    # deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.h
    # deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.h
    # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.h
    # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.h
    # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.h
    # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.cpp
    # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.h
    # deleted: README.md
    #
    # Untracked files:
    # (use "git add <file>..." to include in what will be committed)
    #
    # .Trash/
    # .bash_history
    # .dropbox/
    # .openmdao/
    # .ssh/
    # Documents/2nd_semester/
    # Documents/Arduino/
    # Documents/OpenMDAO/
    # Documents/Personal/
    # Documents/T.A/
    # Documents/gitHub/
    # Documents/mySite/
    # Documents/openFrameworks/
    # Documents/resources/
    # Documents/webcam-pulse-detector-master/
    # Dropbox/
    # Library/
    # Music/
    no changes added to commit (use "git add" and/or "git commit -a")


    Needless to say I'm never able to pull anything. It says that everything is up to date. At certain point I had a repo that uploaded those folders without the files to gitHub but I deleted that.



    Any suggestions?










    share|improve this question













    migrated from stackoverflow.com May 24 '13 at 0:23


    This question came from our site for professional and enthusiast programmers.





















      7












      7








      7


      0






      I created a repo in the wrong folder. Meaning the User folder in OS where all the user folders are from pics, videos to documents. So I pushed that all to gitHub without knowing and now I can't create a repo anymore because the files that I work with are in the documents folder, which is inside the User Folder. And it will imply that I'm creating a repo within a repo. So when I go to terminal and I run git status, it shows me this:



      # On branch master
      # Your branch and 'origin/master' have diverged,
      # and have 2 and 4 different commits each, respectively.
      #
      # Changes not staged for commit:
      # (use "git add/rm <file>..." to update what will be committed)
      # (use "git checkout -- <file>..." to discard changes in working directory)
      #
      # deleted: Documents/m3/m3---Best-Game-Ever
      # deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.h
      # deleted: README.md
      #
      # Untracked files:
      # (use "git add <file>..." to include in what will be committed)
      #
      # .Trash/
      # .bash_history
      # .dropbox/
      # .openmdao/
      # .ssh/
      # Documents/2nd_semester/
      # Documents/Arduino/
      # Documents/OpenMDAO/
      # Documents/Personal/
      # Documents/T.A/
      # Documents/gitHub/
      # Documents/mySite/
      # Documents/openFrameworks/
      # Documents/resources/
      # Documents/webcam-pulse-detector-master/
      # Dropbox/
      # Library/
      # Music/
      no changes added to commit (use "git add" and/or "git commit -a")


      Needless to say I'm never able to pull anything. It says that everything is up to date. At certain point I had a repo that uploaded those folders without the files to gitHub but I deleted that.



      Any suggestions?










      share|improve this question














      I created a repo in the wrong folder. Meaning the User folder in OS where all the user folders are from pics, videos to documents. So I pushed that all to gitHub without knowing and now I can't create a repo anymore because the files that I work with are in the documents folder, which is inside the User Folder. And it will imply that I'm creating a repo within a repo. So when I go to terminal and I run git status, it shows me this:



      # On branch master
      # Your branch and 'origin/master' have diverged,
      # and have 2 and 4 different commits each, respectively.
      #
      # Changes not staged for commit:
      # (use "git add/rm <file>..." to update what will be committed)
      # (use "git checkout -- <file>..." to discard changes in working directory)
      #
      # deleted: Documents/m3/m3---Best-Game-Ever
      # deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/CCLab_2/cclab_sketch_1/src/Boxes.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ball_bouncing/Ball.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/bouncing_ball_classes/src/ball.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/ms_final/src/backGround2.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround.h
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.cpp
      # deleted: Documents/of_v0072_osx_release/apps/myApps/mySketch/src/backGround2.h
      # deleted: README.md
      #
      # Untracked files:
      # (use "git add <file>..." to include in what will be committed)
      #
      # .Trash/
      # .bash_history
      # .dropbox/
      # .openmdao/
      # .ssh/
      # Documents/2nd_semester/
      # Documents/Arduino/
      # Documents/OpenMDAO/
      # Documents/Personal/
      # Documents/T.A/
      # Documents/gitHub/
      # Documents/mySite/
      # Documents/openFrameworks/
      # Documents/resources/
      # Documents/webcam-pulse-detector-master/
      # Dropbox/
      # Library/
      # Music/
      no changes added to commit (use "git add" and/or "git commit -a")


      Needless to say I'm never able to pull anything. It says that everything is up to date. At certain point I had a repo that uploaded those folders without the files to gitHub but I deleted that.



      Any suggestions?







      git github






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 23 '13 at 21:46







      Mauricio Sanchez











      migrated from stackoverflow.com May 24 '13 at 0:23


      This question came from our site for professional and enthusiast programmers.









      migrated from stackoverflow.com May 24 '13 at 0:23


      This question came from our site for professional and enthusiast programmers.
























          1 Answer
          1






          active

          oldest

          votes


















          16














          First things first:





          1. Delete the Github remote repository where you uploaded your user folder (you don't want this to be public)


          2. Delete the local repository in your user folder.



            # Be careful, dangerous command, it will erase your repository 
            # Make sure that you run this from the right folder
            rm -rf .git



          Now, if your local repositories bellow Documents start working again you are done.
          Else, delete and clone each one of them, one by one (of course that this will discard both uncommitted changes and commits that you have not previously pushed).



           cd ~/Documents/gitHub/
          # example, and again, be careful, it will erase your entire folder
          rm -rf repositoryA
          git clone git://github.com/myUser/repositoryA.git
          rm -rf repositoryB
          git clone git://github.com/myUser/repositoryB.git
          # And so on





          share|improve this answer


























          • You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

            – Mauricio Sanchez
            May 23 '13 at 22:30






          • 1





            Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

            – Anthony Accioly
            May 23 '13 at 22:35











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f599289%2fgithub-completely-messed-up-the-local-files-of-github-in-my-computer%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown
























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          16














          First things first:





          1. Delete the Github remote repository where you uploaded your user folder (you don't want this to be public)


          2. Delete the local repository in your user folder.



            # Be careful, dangerous command, it will erase your repository 
            # Make sure that you run this from the right folder
            rm -rf .git



          Now, if your local repositories bellow Documents start working again you are done.
          Else, delete and clone each one of them, one by one (of course that this will discard both uncommitted changes and commits that you have not previously pushed).



           cd ~/Documents/gitHub/
          # example, and again, be careful, it will erase your entire folder
          rm -rf repositoryA
          git clone git://github.com/myUser/repositoryA.git
          rm -rf repositoryB
          git clone git://github.com/myUser/repositoryB.git
          # And so on





          share|improve this answer


























          • You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

            – Mauricio Sanchez
            May 23 '13 at 22:30






          • 1





            Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

            – Anthony Accioly
            May 23 '13 at 22:35
















          16














          First things first:





          1. Delete the Github remote repository where you uploaded your user folder (you don't want this to be public)


          2. Delete the local repository in your user folder.



            # Be careful, dangerous command, it will erase your repository 
            # Make sure that you run this from the right folder
            rm -rf .git



          Now, if your local repositories bellow Documents start working again you are done.
          Else, delete and clone each one of them, one by one (of course that this will discard both uncommitted changes and commits that you have not previously pushed).



           cd ~/Documents/gitHub/
          # example, and again, be careful, it will erase your entire folder
          rm -rf repositoryA
          git clone git://github.com/myUser/repositoryA.git
          rm -rf repositoryB
          git clone git://github.com/myUser/repositoryB.git
          # And so on





          share|improve this answer


























          • You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

            – Mauricio Sanchez
            May 23 '13 at 22:30






          • 1





            Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

            – Anthony Accioly
            May 23 '13 at 22:35














          16












          16








          16







          First things first:





          1. Delete the Github remote repository where you uploaded your user folder (you don't want this to be public)


          2. Delete the local repository in your user folder.



            # Be careful, dangerous command, it will erase your repository 
            # Make sure that you run this from the right folder
            rm -rf .git



          Now, if your local repositories bellow Documents start working again you are done.
          Else, delete and clone each one of them, one by one (of course that this will discard both uncommitted changes and commits that you have not previously pushed).



           cd ~/Documents/gitHub/
          # example, and again, be careful, it will erase your entire folder
          rm -rf repositoryA
          git clone git://github.com/myUser/repositoryA.git
          rm -rf repositoryB
          git clone git://github.com/myUser/repositoryB.git
          # And so on





          share|improve this answer















          First things first:





          1. Delete the Github remote repository where you uploaded your user folder (you don't want this to be public)


          2. Delete the local repository in your user folder.



            # Be careful, dangerous command, it will erase your repository 
            # Make sure that you run this from the right folder
            rm -rf .git



          Now, if your local repositories bellow Documents start working again you are done.
          Else, delete and clone each one of them, one by one (of course that this will discard both uncommitted changes and commits that you have not previously pushed).



           cd ~/Documents/gitHub/
          # example, and again, be careful, it will erase your entire folder
          rm -rf repositoryA
          git clone git://github.com/myUser/repositoryA.git
          rm -rf repositoryB
          git clone git://github.com/myUser/repositoryB.git
          # And so on






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 23 '17 at 12:41









          Community

          1




          1










          answered May 23 '13 at 22:09









          Anthony AcciolyAnthony Accioly

          27625




          27625













          • You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

            – Mauricio Sanchez
            May 23 '13 at 22:30






          • 1





            Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

            – Anthony Accioly
            May 23 '13 at 22:35



















          • You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

            – Mauricio Sanchez
            May 23 '13 at 22:30






          • 1





            Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

            – Anthony Accioly
            May 23 '13 at 22:35

















          You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

          – Mauricio Sanchez
          May 23 '13 at 22:30





          You sir just saved the day!! So I'm guessing that whenever I want to delete something manual and get rid of it completely I have to re -rf .git

          – Mauricio Sanchez
          May 23 '13 at 22:30




          1




          1





          Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

          – Anthony Accioly
          May 23 '13 at 22:35





          Removing the .git folder will remove the repository :). If you want to get rid of a local repository, this is the way to go.

          – Anthony Accioly
          May 23 '13 at 22:35


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f599289%2fgithub-completely-messed-up-the-local-files-of-github-in-my-computer%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

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

          Eduardo VII do Reino Unido