자식의 마지막 버전이
다음 명령을 참조에게 일을 할 것 같다 :
합니다 ([foo]$
명령이는 foo
디렉토리에 실행 표시하기 전에)
[tmp]$ git --version
git version 2.0.0
[tmp]$ git init foo
Initialized empty Git repository in /tmp/foo/.git/
[tmp]$ cd foo
[foo]$ echo hello > file1
[foo]$ echo world > file2
[foo]$ git add .
[foo]$ git commit -m "first commit"
[master (root-commit) 5f7d6b3] first commit
2 files changed, 2 insertions(+)
create mode 100644 file1
create mode 100644 file2
[foo]$ cd ..
[tmp]$ git clone foo bar
Cloning into 'bar'...
done.
여기에 나는 두 개의 repos를 초기화했습니다 foo
및 bar
, bar
은 foo
의 클론입니다. 691,363,210
지금 우리가 지금 당기면 비 충돌 변화를
[tmp]$ cd foo
[foo]$ echo Hello > file1
[foo]$ git commit -am "correct hello > Hello"
[master 183c4a5] correct hello > Hello
1 file changed, 1 insertion(+), 1 deletion(-)
[foo]$ cd ../bar
[bar]$ echo "world !" > file2
[bar]$ git st
On branch master
Your branch is up-to-date with 'origin/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: file2
no changes added to commit (use "git add" and/or "git commit -a")
을 시뮬레이션 할 수 있습니다, 모든 충돌의 변화 (우리는 바는 포함에 unstaget 파일 file2
이 기억으로 그러나 부드럽게
[bar]$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /tmp/foo
5f7d6b3..183c4a5 master -> origin/master
Updating 5f7d6b3..183c4a5
Fast-forward
file1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[bar]$ git st
On branch master
Your branch is up-to-date with 'origin/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: file2
no changes added to commit (use "git add" and/or "git commit -a")
간다 단어 world
)
[bar]$ cd ../foo/
[foo]$ echo World > file2
[foo]$ git commit -am "add World"
[master 7cb10c9] add World
1 file changed, 1 insertion(+), 1 deletion(-)
[foo]$ cd ../bar/
[bar]$ git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /tmp/foo
183c4a5..7cb10c9 master -> origin/master
Updating 183c4a5..7cb10c9
error: Your local changes to the following files would be overwritten by merge:
file2
Please, commit your changes or stash them before you can merge.
Aborting
당김이 예상대로 실패합니다.
Stashing은 분명히 내 표준 방법입니다. 만약 내가 어떤 이유로 든 "단지"내 소중한 일을 숨기지 않는다면 그것은 저지를해야 할 때라. 나는 그 일을하기 전에 그것을한다. – Martin
이 질문은 수퍼 유저로 마이그레이션되어 있어야합니다. – DanFromGermany