Domanda

I am still figuring out the basics with Git and using GitHub as my online repository. So while I was trying to teach myself and figure out everything, I guess I might of went crazy with the installing of different versions of Git Bash, Git GUI, Git Windows, Git Extensions, but the one I primarily use is Git Bash.

I must of went crazy with the "git init" command, because I have a ton of files showing up when I do a "git status." I am also tracking multiple repos, but I just want to be working with only one at a time. So my question, finally, is how do I resolve these conflicts and only work with one .git at a time through Git bash on my local machine?

This is what currently shows up when I do a "git status"

$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 1 different commit(s) each, respectively.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#   (commit or discard the untracked or modified content in submodules)
#
#       modified:   ../../../GitHub/GitHelloWorld (new commits)
#       modified:   ../../../GitHub/StopFoodWaste (new commits, modified content
)
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       ../../../../.RubyMine40/
#       ../../../../.android/
#       ../../../../.appletviewer
#       ../../../../.asadminpass
#       ../../../../.bash_history
#       ../../../../.gem/
#       ../../../../.gitconfig
#       ../../../../.gitignore
#       ../../../../.kdiff3rc
#       ../../../../.m2/
#       ../../../../.ssh/
#       ../../../../AppData/
#       ../../../../Contacts/
#       ../../../../Desktop/
#       ../../../../DiskScrP.txt
#       ../../../AdventureWorks2012_Data.mdf
#       ../../../Amazon MP3/
#       ../../../Battlefield 3/
#       ../../../BinaryTreeADT.class
#       ../../../BinaryTreeADT.java
#       ../../../CyberLink/
#       ../../../DataStrucNotes.docx
#       ../../../Dimitrios Arethas.docx
#       ../../../Dimitrios_Arethas_resume.rtf
#       ../../../Dimitrios_Arethas_resume_doc.docx
#       ../../../Expression/
#       ../../../Fiddler2/
#       ../../../German Reporter.m4v
#       ../../../GoogleCodeJam.class
#       ../../../GoogleCodeJam.java
#       ../../../Greatwide_cover.docx
#       ../../../IISExpress/
#       ../../../ITCS2175/
#       ../../../ITCS2214/
#       ../../../ITCS3200 Notes.docx
#       ../../../ITIS - Ethics/
#       ../../../Music/
#       ../../../My Kindle Content/
#       ../../../My Shapes/
#       ../../../My Web Sites/
#       ../../../Notes/
#       ../../../ProjectEuler.class
#       ../../../ProjectEuler.java
#       ../../../SQL Learn/
#       ../../../SQL Server Management Studio/
#       ../../../SaaS Class/
#       ../../../SharpDevelop Projects/
#       ../../../Visual Studio 11/
#       ../../../Visual Studio 2005/
#       ../../../Visual Studio 2008/
#       ../../
#       ../../../Youcam/
#       ../../../dativ_prepositions.docx
#       ../../../desktop.ini
#       ../../../dimitrios_engagement_checklist.doc
#       ../../../dimitrios_trial_schedule.doc
#       ../../../eclipse/
#       ../../../gitscc.config
#       ../../../me.jpg
#       ../../../workspace-sts-2.9.1.RELEASE/
#       ../../../../Downloads/
#       ../../../../Dropbox/

no changes added to commit (use "git add" and/or "git commit -a")
È stato utile?

Soluzione

On the remote side, you can view your remotes repo with git remote:

git remote -v

And remove the ones you don't want with

git remote rm name

See "Working with Remotes".

On the status side, try to find all .git directories you have. You should be in a GitHub/yourRepo directory instead of having a .git almost at your C:\ here.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top