1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| vagabond@Erna ~ $ mkdir depot
vagabond@Erna ~ $ cd depot/
vagabond@Erna depot $ git init
Initialized empty Git repository in /home/vagabond/depot/.git/
vagabond@Erna depot $ echo a > a.txt
vagabond@Erna depot $ git add a.txt
vagabond@Erna depot $ git ci -m "Premier commit"
[master (root-commit) 6c69758] Premier commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 a.txt
vagabond@Erna depot $ cd ..
vagabond@Erna ~ $ git clone --bare depot/.git
Cloning into bare repository depot.git...
done.
vagabond@Erna ~ $ rm -rf depot
vagabond@Erna ~ $ git clone depot.git clone1
Cloning into clone1...
done.
vagabond@Erna ~ $ git clone depot.git clone2
Cloning into clone2...
done.
vagabond@Erna ~ $ cd clone2/
vagabond@Erna clone2 $ echo b > b.txt
vagabond@Erna clone2 $ git add b.txt
vagabond@Erna clone2 $ git ci -m "Deuxième commit"
[master 09984f3] Deuxième commit
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 b.txt
vagabond@Erna clone2 $ git push
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 278 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To /home/vagabond/depot.git
6c69758..09984f3 master -> master
vagabond@Erna clone2 $ cd ../clone1/
vagabond@Erna clone1 $ git pull
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/vagabond/depot
6c69758..09984f3 master -> origin/master
Updating 6c69758..09984f3
Fast-forward
b.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 b.txt
vagabond@Erna clone1 $ ls
a.txt b.txt |
Partager