2012-10-08 53 views
1

我想用roots作爲我的首發主題,嘗試設置我的第一個基於Git的WordPress主題開發。我打算在本地開發一個主題,然後偶爾推送到我的Dreamhost VPS。閱讀關於Dreamhost Wiki的一些信息。我也跟着David Winter's tutorial設置了Git的WordPress核心更新選項。 我還以主題根作爲基礎,爲我的主題設置了另一個回購。也許我應該已經把它做成了一個子模塊,但是我只是在這裏做了一些學習......我在服務器上設置了一個裸回購,並在本地嘗試了一個拉請求,但這不起作用。在Dreamhost上用Git開發WordPress主題

本地

對於我本地的主題我有這樣的:

$ pwd 
/opt/local/www/imagewize/wp-content/themes/img/.git 
jaspersmbp:.git jasper$ cat config 

,並在這裏爲主題git的配置文件:

[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 
    ignorecase = true 
[remote "origin"] 
    url = ssh://[email protected]/~/domain.com/wp-content/themes/img 
    fetch = +refs/heads/*:refs/remotes/origin/* 

WordPress的子模塊細節: 位置:

$ pwd 
/opt/local/www/imagewize 

Git的配置文件:

core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 
    ignorecase = true 
[submodule "wordpress"] 
    url = git://github.com/WordPress/WordPress.git 

遠程

在遠程DH VPS主題裏面我有這樣的配置:當我的主題內本地

core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = true 

和嘗試連接到Dreamhost VPS我得到:

$ git pull origin master 
    fatal: Couldn't find remote ref master 
    me:img jasper$ fatal: The remote end hung up unexpectedly 

調試

$ git branch -a 

負載縹緲本地..

git push origin master 
error: src refspec master does not match any. 
error: failed to push some refs to 'ssh://[email protected]/~/imagewize.com/wp-content/themes/img' 

更新

在配置

調整網址,現在我得到:

git push origin master 
fatal: '/imagewize.com/wp-content/themes/img' does not appear to be a git repository 
fatal: The remote end hung up unexpectedly 

更新II

我做了一些更多的在線閱讀,我發現src refspec master does not match any when pushing commits in git後,我意識到我沒有做補充,但沒有提交。

git commit -m 'Initial commit' 
[master (root-commit) 7bbcd6a] Initial commit 
137 files changed, 17766 insertions(+) 
create mode 100644 .gitignore 
......... 

然後:

$ git push origin master 
Counting objects: 150, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (144/144), done. 
Writing objects: 100% (150/150), 259.70 KiB, done. 
Total 150 (delta 26), reused 0 (delta 0) 
To ssh://[email protected]/~/domain.com/wp-content/themes/img/ 
* [new branch]  master -> master 

而且我們是啓動和運行!

只是不知我的本地文件沒有上傳到遠程的主題文件夾

$ ls -lha 
total 16K 
drwxrwxr-x 7 me server 147 Oct 7 20:21 . 
drwxr-xr-x 6 me server 105 Oct 7 20:21 .. 
-rw-rw-r-- 1 me server 23 Oct 7 20:21 HEAD 
drwxrwxr-x 2 me server 10 Oct 7 20:21 branches 
-rw-rw-r-- 1 me server 66 Oct 7 20:21 config 
-rw-rw-r-- 1 me server 73 Oct 7 20:21 description 
drwxrwxr-x 2 me server 4.0K Oct 7 20:21 hooks 
drwxrwxr-x 2 me server 28 Oct 7 20:21 info 
drwxrwxr-x 4 me server 40 Oct 7 20:21 objects 
drwxrwxr-x 4 me server 41 Oct 7 20:21 refs 

,但我要工作了這一點很快..

更新III

裸倉庫做沒有一個工作目錄,似乎解釋here。他們似乎說我應該克隆生產。所以無論我在哪裏創建裸倉庫,都不是我克隆最終結果的地方。

回答

0

只需更改設置即可。我推動的地方只是用於跟蹤Github等變化的git回購以及我希望獲得最終結果的任何地方,我將克隆回購。