Using Michael Hartl’s Ruby on Rails instructions, I typed the following into the command line:
$ git init
$ git add .
$ git status
The output I got doesn’t make sense. It looks like everything on my computer is being committed, i.e. my web browsing history.
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: .DS_Store
# new file: .Trash/.DS_Store
# modified: .bash_history
# modified: .gem/specs/rubygems.org%80/latest_specs.4.8
# new file: .gem/specs/rubygems.org%80/quick/Marshal.4.8/treetop-1.4.12.gemspec
# new file: .gem/specs/rubygems.org%80/quick/Marshal.4.8/tzinfo-0.3.34.gemspec
# modified: .gem/specs/rubygems.org%80/specs.4.8
# modified: Desktop/.DS_Store
# modified: Library/Application Support/AddressBook/Metadata/.info
# modified: Library/Application Support/AddressBook/Sources/7A5B88B6-2E8C-44D5-B3C5-96C523D66818/Metadata/.info
# modified: Library/Application Support/CrashReporter/Intervals_31838DA3-3634-5B48-BAA4-074D9844D0AB.plist
# modified: Library/Application Support/Dock/FD847662-EDEA-43DC-8969-18D1DD48507E.db
# modified: Library/Application Support/Sublime Text 2/Settings/Auto Save Session.sublime_session
# modified: Library/Application Support/Ubiquity/peer-0773FD5E-421F-A363-E209-F9D5E42A0F5F-v23/item-info.db
# new file: Library/Caches/Metadata/Safari/Bookmarks/2AD8D7AF-5B59-4BF5-9C80-749756908961.webbookmark
# modified: Library/Caches/Metadata/Safari/History/.tracked filenames.plist
# new file: Library/Caches/Metadata/Safari/History/Safari history item-282.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-283.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-284.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-285.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-286.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-287.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-288.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-289.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-290.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-291.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-292.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-293.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-294.webhistory
# new file: Library/Caches/Metadata/Safari/History/Safari history item-295.webhistory
Before trying to commit, I had ran $ rails server in a different terminal and got the output below:
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-10-31 12:30:26] INFO WEBrick 1.3.1
[2012-10-31 12:30:26] INFO ruby 1.9.3 (2012-10-12) [x86_64-darwin12.2.0]
[2012-10-31 12:30:26] INFO WEBrick::HTTPServer#start: pid=3773 port=3000
Started GET "/assets/rails.png" for 127.0.0.1 at 2012-10-31 12:52:53 -0400
Connecting to database specified by database.yml
Served asset /rails.png - 200 OK (3ms)
From a previous question, I know $ rails server will continue to run until I close the terminal window. Please help! Why is everything from my computer, including web history being committed to Git?
Because you ran the command in your homefolder. You need to use
cd /path/to/your/codeto ensure that you are in the code folder. Usepwdto see the directory you are currently in.