我不肯定爲何我沒法檢出我之前處理過的分支。 請參閱如下命令(注意: co
是checkout
的別名): git
ramon@ramon-desktop:~/source/unstilted$ git branch -a * develop feature/datts_right feature/user_controlled_menu feature/user_controlled_site_layouts master remotes/origin/HEAD -> origin/master remotes/origin/develop remotes/origin/feature/datts_right remotes/origin/master ramon@ramon-desktop:~/source/unstilted$ git co feature/user_controlled_site_layouts error: pathspec 'feature/user_controlled_site_layouts' did not match any file(s) known to git.
我不肯定這意味着什麼,並且在Google上找不到我能理解的任何東西。 bash
我如何結賬該分支,我該怎麼作才能打破這一分支? this
更新 : spa
我找到了這篇文章 ,並運行git show-ref
給我: 3d
97e2cb33914e763ff92bbe38531d3fd02408da46 refs/heads/develop c438c439c66da3f2356d2449505c073549b221c1 refs/heads/feature/datts_right 11a90dae8897ceed318700b9af3019f4b4dceb1e refs/heads/feature/user_controlled_menu c889b37a5ee690986935c9c74b71999e2cf3c6d7 refs/heads/master c889b37a5ee690986935c9c74b71999e2cf3c6d7 refs/remotes/origin/HEAD e7c17eb40610505eea4e6687e4572191216ad4c6 refs/remotes/origin/develop c438c439c66da3f2356d2449505c073549b221c1 refs/remotes/origin/feature/datts_right c889b37a5ee690986935c9c74b71999e2cf3c6d7 refs/remotes/origin/master 23768aa5425cbf29d10ff24274adad42d90d15cc refs/stash e572cf91e95da03f04a5e51820f58a7306ce01de refs/tags/menu_shows_published_only 429ebaa895d9d41d835a34da72676caa75902e3d refs/tags/slow_dev
.git
目錄的更新 ( user_controlled_site_layouts
在refs/heads/feature folder
): code
$ ls .git/refs/heads/feature/ datts_right user_controlled_menu user_controlled_site_layouts $ cat .git/refs/heads/feature/user_controlled_site_layouts 3af84fcf1508c44013844dcd0998a14e61455034
git show 3af84fcf1508c44013844dcd0998a14e61455034
更新 orm
$ git show 3af84fcf1508c44013844dcd0998a14e61455034 commit 3af84fcf1508c44013844dcd0998a14e61455034 Author: Ramon Tayag <xxx@xxxxx.xxx> Date: Thu May 12 19:00:03 2011 +0800 Removed site layouts migration diff --git a/db/schema.rb b/db/schema.rb index 1218fc8..2040b9f 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20110511012647) do +ActiveRecord::Schema.define(:version => 20110503040056) do create_table "attachments", :force => true do |t| t.string "name" @@ -205,15 +205,6 @@ ActiveRecord::Schema.define(:version => 20110511012647) do t.integer "old_id" end - create_table "site_layouts", :force => true do |t| - t.string "name" - t.text "description" - t.text "content" - t.integer "site_id" - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "site_styles", :force => true do |t| t.text "published" t.datetime "created_at"
我在git-bash上遇到相同的pathspec error
。 我在Windows上使用Tortoise git來切換/簽出分支。 ip
我遇到了一樣的問題..當我嘗試執行如下操做時,我覺得本身有一個名爲foo
分支: rem
git checkout foo
我獲得: get
error: pathspec 'foo' did not match any file(s) known to git.
而後,我嘗試使用完整的分支名稱:
git checkout feature/foo
而後爲我工做。
若是您使用git branch -D yourbranchname
刪除了一個分支,並再次拉/克隆了您的git branch -D yourbranchname
,則可能須要再次建立本地分支。
嘗試:
git checkout -b yourbranchname
Git Windows用戶要注意-若是沒有--icase-pathspecs
或GIT_ICASE_PATHSPECS = 1
env var設置 ,則git pathspecs區分大小寫,在這種狀況下
git checkout origin/FooBranch "Some/Path/To/File.txt"
與...不一樣
git checkout origin/FooBranch "some/path/to/file.Txt"
這多是上游重寫歷史記錄時引發的。
發生這種狀況時,我將全部受影響的存儲庫扔掉,從上游克隆它們,而後使用'git format-patch'/'git am'將全部正在進行的工做從舊世界遷移到新世界。