-2

使用 Michael Hartl 的 Ruby on Rails 说明,我在命令行中输入了以下内容:

$ git init
$ git add .
$ git status

我得到的输出没有意义。看起来我计算机上的所有内容都已提交,即我的网络浏览历史记录。

# 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

在尝试提交之前,我$ rails server在另一个终端中运行并得到以下输出:

=> 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)

从上一个问题,我知道$ rails server将继续运行,直到我关闭终端窗口。请帮忙!为什么我的计算机中的所有内容,包括网络历史记录都提交给 Git?

4

1 回答 1

8

因为您在主文件夹中运行了该命令。您需要使用cd /path/to/your/code以确保您在代码文件夹中。用于pwd查看您当前所在的目录。

于 2012-10-31T17:29:12.937 回答