git.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 01 Mar 2011 17:16:20 +0200
changeset 836 64ecb45d68fa
parent 835 d0bddeaf586b
child 899 7b4265c8d324
permissions -rw-r--r--
git analog of 'hg outgoing'.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
735
5c437e2d5fe1 Fix Emacs settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 231
diff changeset
     1
-*- mode: outline; coding: utf-8; fill-column: 80 -*-
61
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
* Setup git.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
** Debian.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
For Etch Degian release use git-core package from backports,
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
old 1.4 version of git very dumb compared to new version 1.5.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
  $ sudo apt-get install git-core
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
After install setup some options:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
  $ git config --global user.name "Oleksandr Gavenko"
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
  $ git config --global user.mail "gavenkoa@gmail.com"
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
  $ cat ~/.gitconfig
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
[user]
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
    name = Oleksandr Gavenko
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
    mail = gavenkoa@gmail.com
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
230
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    21
** Windows.
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    22
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    23
No official support for Windows OS.
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    24
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    25
*** Cygwin.
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    26
832
d3b96f56c613 setup.exe -p git
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 828
diff changeset
    27
  $ setup.exe -p git
d3b96f56c613 setup.exe -p git
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 828
diff changeset
    28
230
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    29
*** MSys.
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    30
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    31
Native port.
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    32
231
3b3680e6d481 How config git on windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
    33
  $ cat gitconfig
3b3680e6d481 How config git on windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
    34
[core]
3b3680e6d481 How config git on windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
    35
autocrlf = false
3b3680e6d481 How config git on windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
    36
symlinks = false
3b3680e6d481 How config git on windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 230
diff changeset
    37
230
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    38
  http://code.google.com/p/msysgit
438e70eaa36b Git on Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 64
diff changeset
    39
828
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    40
* git over proxy.
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    41
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    42
Only http:// protocol support proxy (not git://).
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    43
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    44
  $ export http_proxy="http://username:password@proxy:port/"
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    45
  $ git clone http://github.com/$user/$proj.git $proj
e75285735442 git over proxy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
    46
836
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
    47
You can store proxy settings under repository local config file:
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
    48
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
    49
  $ git config http.proxy http://$user:$passwd@$ip:$port
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
    50
61
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    51
* Start your project.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    52
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    53
Setup proj space on fs.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    54
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    55
  $ mkdir proj
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    56
  $ cd proj
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    57
  $ git init
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    58
Initialized empty Git repository in /home/user/tmp/proj/.git/
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
  $ ls -a
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
. .. .git
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    62
Add file, make changes, commit all.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    63
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    64
  $ emacs Makefile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
... C-x C-c
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
  $ emacs app.c
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
... C-x C-c
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    68
  $ git add Makefile app.c
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    69
  $ git status
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    70
# On branch master
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    71
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    72
# Initial commit
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    73
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
# Changes to be committed:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
#   (use "git rm --cached <file>..." to unstage)
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
#       new file: Makefile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    78
#       new file: app.c
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    79
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
or just
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
  $ git add .
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
Commit newlly added file:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
  $ git commit
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
... Write message log ...
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
Created initial commit 2169263: My first commit massage.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
 1 files changed, 4 insertions(+), 0 deletions(-)
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
 create mode 100644 app.c
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
* Undo tracking added file.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
You do
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
  $ git add badfile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
  $ git status
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    99
# On branch master
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   100
# Changes to be committed:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   101
#   (use "git reset HEAD <file>..." to unstage)
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   102
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   103
#       new file:   badfile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   105
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   106
To stop tracking badfile do
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   107
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   108
  $ git rm --cached badfile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   109
  $ git status
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   110
# On branch master
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   111
# Untracked files:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   112
#   (use "git add <file>..." to include in what will be committed)
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   113
#
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   114
#       file
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   115
nothing added to commit but untracked files present (use "git add" to track)
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   116
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   117
or
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   118
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   119
  $ git reset badfile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   120
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   121
* Doing changes.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   122
835
d0bddeaf586b minor fix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 834
diff changeset
   123
  $ printf "clean:\n<TAB>rm $(wildcard *.o)\n" >>Makefile
61
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   124
  $ git diff
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   125
diff --git a/Makefile b/Makefile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   126
index e84f7e9..cd2438a 100644
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
--- a/Makefile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   128
+++ b/Makefile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   129
@@ -1,2 +1,5 @@
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   130
 all:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   131
        @echo XXX
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
        exit 1
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   133
+
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   134
+clean:
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   135
+       rm -f *.o
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   136
  $ git add Makefile
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   137
  $ git commit -m "Added clean target."
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   138
Created commit 11272b9: Added clean target.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   139
 1 files changed, 1 insertions(+), 0 deletions(-)
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   140
 create mode 100644 file
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   141
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
or just
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
  $ git commit -a -m "Added clean target."
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   145
833
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   146
* git analog of 'hg incoming'.
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   147
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   148
git does not directly support such feature. You can emulate it by:
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   149
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   150
  $ git fetch
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   151
  $ git log master..origin/master   # or just '..origin/master'
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   152
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   153
By previous commands you grab changes from remote server! You can apply them:
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   154
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   155
  TODO
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   156
  $ git merge
2fc97313ce78 git analog of 'hg incoming'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 832
diff changeset
   157
836
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   158
* git analog of 'hg outgoing'.
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   159
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   160
git does not directly support such feature. You can emulate it by:
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   161
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   162
  $ git fetch
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   163
  $ git log origin/master..master   # or just 'origin/master..'
64ecb45d68fa git analog of 'hg outgoing'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 835
diff changeset
   164
834
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   165
* Debug git network operation.
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   166
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   167
Git uses libcurl for network operation.
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   168
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   169
  $ export GIT_CURL_VERBOSE=1
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   170
  $ git ...
5bed6172a7c4 Debug git network operation.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 833
diff changeset
   171
61
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   172
* Using git to work with SVN offline.
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
62
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   174
Prepare SVN and git utilities:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   175
61
997e7523b171 About git.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   176
  $ sudo apt-get svn git-core git-svn
62
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   177
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   178
Making SVN repo
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   179
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   180
  $ cd $HOME/tmp
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   181
  $ svnadmin create svn-repo
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   182
  $ svn co file://$HOME/tmp/svn-repo svn-devel
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   183
  $ cd svn-devel
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   184
  $ mkdir tags trunk branches
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   185
  $ svn add *
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   186
A         branches
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   187
A         tags
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   188
A         trunk
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   189
  $ cd trunk/
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   190
  $ printf "all:\n  echo XXX\n" >Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   191
  $ printf "int main() {return 0;}" >main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   192
  $ svn add *
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   193
  $ cd ..
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   194
  $ svn st
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   195
A      trunk
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   196
A      trunk/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   197
A      trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   198
A      branches
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   199
A      tags
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   200
  $ svn ci -m init
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   201
Adding         branches
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   202
Adding         tags
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   203
Adding         trunk
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   204
Adding         trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   205
Adding         trunk/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   206
Transmitting file data ..
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   207
  $ svn cp -m v0.0 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/tags/v0.0
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   208
  $ svn cp -m v0.1 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/branches/v0.1
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   209
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   210
Moving SVN changset to git repo
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   211
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   212
  $ cd $HOME/tmp
63
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 62
diff changeset
   213
  $ git svn init file://$HOME/tmp/svn git-repo
62
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   214
  $ ls -a
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   215
.  ..  .git
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   216
  $ git svn fetch
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   217
    A   trunk/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   218
    A   trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   219
W: +empty_dir: branches
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   220
W: +empty_dir: tags
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   221
r1 = 52ccd9882979dd53ec198dbac108783ec660410f (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   222
    A   tags/v0.0/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   223
    A   tags/v0.0/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   224
r2 = 8ec8a772bb6f37ace56b3649066dc84e481ed427 (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   225
    M   trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   226
r3 = 2c169ff409ed504dd6a092b1e302beb3fd94871e (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   227
    A   branches/v0.1/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   228
    A   branches/v0.1/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   229
r4 = e68d76f4ba6beea4b9059c1884c1f38ce10831a7 (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   230
    M   trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   231
r5 = cdde63974454b13ac53f2eeb201aa76c49fd875c (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   232
Checked out HEAD:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   233
  file:///home/sasha/tmp/svn r5
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   234
63
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 62
diff changeset
   235
or (in old git version):
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 62
diff changeset
   236
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 62
diff changeset
   237
  $ git svn clone file://$HOME/tmp/svn git-repo
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 62
diff changeset
   238
62
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   239
Making changes in svn:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   240
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   241
  $ cd $HOME/tmp/svn-devel/trunk
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   242
  $ echo ".PHONY: clean" >>Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   243
  $ svn ci -m "Added clean to phony."
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   244
Sending        trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   245
Transmitting file data .
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   246
Committed revision 6.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   247
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   248
Making committed in git:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   249
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   250
  $ cd $HOME/tmp/git-repo/trunk
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   251
  $ echo ".PHONY: all" >>Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   252
  $ echo "int foo(int x) {return x+x;}" >>main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   253
  $ git status
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   254
# On branch master
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   255
# Changed but not updated:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   256
#   (use "git add <file>..." to update what will be committed)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   257
#
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   258
#       modified:   Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   259
#       modified:   main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   260
#
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   261
no changes added to commit (use "git add" and/or "git commit -a")
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   262
  $ git commit -a -m "Bug fixed."
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   263
Created commit 222d399: Bug fixed.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   264
 2 files changed, 2 insertions(+), 0 deletions(-)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   265
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   266
Getting changes from SVN to git:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   267
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   268
  $ git svn rebase
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   269
    M   trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   270
r6 = 8165e9bfb38e9df09a7313d19606ec227629b670 (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   271
First, rewinding head to replay your work on top of it...
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   272
Applying Bug fixed.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   273
error: patch failed: trunk/Makefile:6
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   274
error: trunk/Makefile: patch does not apply
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   275
Using index info to reconstruct a base tree...
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   276
Falling back to patching base and 3-way merge...
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   277
Auto-merged trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   278
CONFLICT (content): Merge conflict in trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   279
Failed to merge in the changes.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   280
Patch failed at 0001.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   281
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   282
When you have resolved this problem run "git rebase --continue".
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   283
If you would prefer to skip this patch, instead run "git rebase --skip".
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   284
To restore the original branch and stop rebasing run "git rebase --abort".
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   285
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   286
rebase refs/remotes/git-svn: command returned error: 1
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   287
  $ git add Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   288
  $ git rebase --continue
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   289
Applying Bug fixed.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   290
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   291
and return all from git to SVN:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   292
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   293
  $ git svn dcommit
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   294
Committing to file:///home/sasha/tmp/svn ...
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   295
    M   trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   296
    M   trunk/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   297
Committed r7
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   298
    M   trunk/main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   299
    M   trunk/Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   300
r7 = 68e782c8d06635f2db4dd69b9ca8599f99da22e2 (git-svn)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   301
No changes between current HEAD and refs/remotes/git-svn
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   302
Resetting to the latest refs/remotes/git-svn
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   303
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   304
See what going to SVN repo:
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   305
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   306
  $ cd $HOME/tmp/svn-devel/trunk
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   307
  $ svn diff -r BASE:HEAD
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   308
Index: Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   309
===================================================================
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   310
--- Makefile    (working copy)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   311
+++ Makefile    (revision 7)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   312
@@ -6,4 +6,4 @@
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   313
 .o: .c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   314
    $(CC) $(CFLAGS) -c -o $@ $<
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   315
 
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   316
-.PHONY: clean
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   317
+.PHONY: all clean
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   318
Index: main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   319
===================================================================
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   320
--- main.c  (working copy)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   321
+++ main.c  (revision 7)
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   322
@@ -2,3 +2,4 @@
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   323
 {
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   324
     return 0;
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   325
 }
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   326
+int foo(int x) {return x+x;}
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   327
  $ svn up
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   328
U    Makefile
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   329
U    main.c
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   330
Updated to revision 7.
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   331
64
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   332
* gitk
62
4cda4557f554 git SVN tutorial.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 61
diff changeset
   333
64
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   334
gitk - The git repository browser
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   335
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   336
Installing:
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   337
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   338
  $ sudo apt-get instal gitk
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   339
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   340
Using:
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   341
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   342
  $ cd /path/to/git-repo
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   343
  $ gitk
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   344
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   345
See
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   346
921f4325779b add gitk
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 63
diff changeset
   347
  gitk(1)