Reputation: 157
I'm new to git and have done multiple small practice rails projects. I recently started a tutorial and git was acting kind of funky. I created a new branch and used the same name as I did in another project's branch. It started to reference all the changes I did in that project but in my new one. I resolved that issue by just adding and committing blindly. But now when I do a git status in the master branch of my new project I get the below untracked files message. Some of the files are referencing my Civ game.
After doing the git add -A at the end, I do a git status and it spits out a million lines of red text referencing youtube. I do a git reset to reverse.
My Question: How can I resolve this? Why does a git status reference changes from other projects and applications on my computer in a completely new project?
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
../../../.CFUserTextEncoding
../../../.Trash/
../../../.bash_history
../../../.bash_profile
../../../.bash_sessions/
../../../.bashrc
../../../.bundle/
../../../.config/
../../../.gem/
../../../.gemrc
../../../.gitconfig
../../../.heroku/
../../../.irb-history
../../../.matplotlib/
../../../.mkshrc
../../../.netrc
../../../.node_repl_history
../../../.profile
../../../.rvm/
../../../.ssh/
../../../.subversion/
../../../.viminfo
../../../.zlogin
../../../.zshrc
../../../Applications/
../../.localized
../../Bomb/
../../Conditionals.playground/
../../Desktop/
../../Dev/
../../Exercise.playground/
../../Green_guy.html
../../Green_guy_style.css
../../Hartl/
../../Hello World/
../../Mathops.playground/
../../Screen Shot 2016-02-08 at 9.14.15 PM.png
../../Sid Meier's Civilization V.app/
../../SuperCool/
../../Terminal.app/
../../Variables.playground/
../../another-git-test/
../../arrays.playground/
../../auto-layout-advanced/
../../auto-layout-test/
../../autolayout-pratice/
../../autolayout/
../../autolayoutconstrants/
../../boston/
../../cw.py
../../cw.rb
../../function.playground/
../../git-fun/
../../google_logo.jpg
../../googlepage.css
../../googlepage.html
../../lesson_3 (old)/
../../logo.jpg
../../loops.playground/
../../multiples-project/
../../numbers.playground/
../../practice/
../../practicePush/
../../project/
../../rails/
../this/
../../sample.pdf
../../scrape.py
../../scraper.py
../../stackview.playground/
../../stackview/
../../tapper/
../../test.html
../../test_post/
../../../Documents/
../../../Downloads/
../../../Library/
../../../Movies/
../../../Music/
../../../Pictures/
../../../Public/
../../../google-homepage/
../../../railsbridge/
nothing added to commit but untracked files present (use "git add" to track)
-MacBook-Air:lesson-3 wick$ git add -A
Upvotes: 0
Views: 1581
Reputation: 141946
You have initialized git under the displayed folder.
Once you execute a git init
with no parameters is creating a git repository under the current directory.
If you wish to create a git repository in a different directory you have to supply the repository name: git init <repo name>
How can I resolve this?
Simply delete the .git
folder and it content and the folder will no longer will be tracked by git
Why does a git status reference changes from other projects and applications on my computer in a completely new project?
Since you have initialized git in the current directory.
git init
- Create an empty Git repository or reinitialize an existing one
Upvotes: 0
Reputation: 98459
You have a .git folder in your home directory.
Thus, everything under your homedir is being treated as part of one giant repository. You probably ran "git init" from the wrong place by accident.
Remove the errant .git folder.
Upvotes: 4