必須有你留下了一些東西,因爲它,其實,值得這樣:
$ mkdir default
$ cd default/
$ git init
Initialized empty Git repository in /Users/jim/Desktop/default/.git/
$ echo "A" > A; echo "B" > B; echo "C" > C
$ git add . && git commit -m "Initial commit"
[master (root-commit) 318f655] Initial commit
3 files changed, 3 insertions(+), 0 deletions(-)
create mode 100644 A
create mode 100644 B
create mode 100644 C
$ cd ..
$ git clone ./default ./defaultmods
Initialized empty Git repository in /Users/jim/Desktop/defaultmods/.git/
$ cd defaultmods/
$ echo "D" > D; echo "E" > E; echo "F" > F
$ cd ../default
$ echo "A, updated" > A; echo "C, updated" > C; echo "G" > G
$ git add . && git commit -m "Upstream update"
[master 4485f72] Upstream update
3 files changed, 3 insertions(+), 2 deletions(-)
create mode 100644 G
$ cd ../defaultmods/
$ git add . && git commit -m "Mods commit"
[master a393e70] Mods commit
3 files changed, 3 insertions(+), 0 deletions(-)
create mode 100644 D
create mode 100644 E
create mode 100644 F
$ git pull
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From /Users/jim/Desktop/./default
318f655..4485f72 master -> origin/master
Merge made by recursive.
A | 2 +-
C | 2 +-
G | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
create mode 100644 G
$ cat *
A, updated
B
C, updated
D
E
F
G
感謝大家的全力幫助。我通過刪除所有內容,克隆它,然後應對我的更改來實現它。當我開始搞砸索引時,我一定做了一些事情。現在她工作得很好。 – that0n3guy 2009-07-20 14:39:41