所以我是在Ruby on Rails中工作的新手。我承諾所有的東西,並把它推到混帳,然後我的項目恢復到舊版本。我的最新版本安全地存儲在git上,但現在我的計算機上的所有原始文件都消失了,並替換爲舊版本。這是怎麼回事?推到Git,一切都消失了?
編輯:更多細節:
git status
# On branch master
# 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)
#
# modified: .DS_Store
# modified: app/.DS_Store
# modified: app/assets/stylesheets/static_pages.css.scss
# modified: app/views/static_pages/home.html.erb
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# app/assets/.DS_Store
# app/assets/images/.DS_Store
# public/chat.png
# public/groups.png
# public/join-free.png
# public/login-button.png
# public/meetups.png
# public/people.png
# public/posts.png
# public/profile.png
# public/stream.png
# public/streambaby.png
# public/streamblue.png
# public/streamlime.png
no changes added to commit (use "git add" and/or "git commit -a")
Lasers-MacBook-Pro:meetumea lasernite$ git add .
Lasers-MacBook-Pro:meetumea lasernite$ git commit -m "home page basic"
[master 49921d4] home page basic
Committer: Laser Nite <[email protected]>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
18 files changed, 144 insertions(+), 9 deletions(-)
create mode 100644 app/assets/.DS_Store
create mode 100644 app/assets/images/.DS_Store
rewrite app/assets/stylesheets/static_pages.css.scss (100%)
rewrite app/views/static_pages/home.html.erb (100%)
create mode 100644 public/chat.png
create mode 100644 public/groups.png
create mode 100644 public/join-free.png
create mode 100644 public/login-button.png
create mode 100644 public/meetups.png
create mode 100644 public/people.png
create mode 100644 public/posts.png
create mode 100644 public/profile.png
create mode 100644 public/stream.png
create mode 100644 public/streambaby.png
create mode 100644 public/streamblue.png
create mode 100644 public/streamlime.png
Lasers-MacBook-Pro:meetumea lasernite$ git branch
* master
work
Lasers-MacBook-Pro:meetumea lasernite$ git push
Counting objects: 39, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (27/27), 60.94 KiB, done.
Total 27 (delta 11), reused 0 (delta 0)
To [email protected]:lasernite/meetumea.git
a78c8f0..49921d4 master -> master
Lasers-MacBook-Pro:meetumea lasernite$ git status
# On branch master
nothing to commit (working directory clean)
Lasers-MacBook-Pro:meetumea lasernite$ git co work
Switched to branch 'work'
Lasers-MacBook-Pro:meetumea lasernite$ git status
# On branch work
nothing to commit (working directory clean)
然後我發現我的所有文件都是舊版本,我所有的新形象從公衆文件夾不見了。我只是運行rm -rf meetumea,然後從github克隆我的項目,這樣問題就解決了。不過,我仍然想知道發生了什麼。
不知道發生了什麼,需要更多的細節。我會試着從Github上拉,如果這不起作用,你可能不得不恢復到你當地回購的過去狀態。 – 2012-03-15 02:09:52
你跑的確切命令是什麼? – 2012-03-15 02:15:58
編輯 - 添加了通過終端的所有內容。 – Laser 2012-03-15 02:20:59