Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Git in 90 Minutes
1By Vimukthi Randika
What’s GIT
2
Open source Version
Control System
Designed and developed
by Linus Torvalds
for Linux kernel
GNU General Publ...
Why GIT
3
Distributed
Full control over
local copy
Fast and can be
done offline
Not have a single
point of failure
Adjusta...
Why GIT
4
Branching
Frictionless context
switching
1/3 s vs 13 s
(GIT vs SVN)
Enable parallel
work
Easy merging
Lightweight
Why GIT
5
Staging
Purified History Partial commits
Logically separate
change sets
Edit commits
Workflow
Remote Repo
Local
Master
Branch A
Branch B
Branch C
6
Initializing Repository
git init
git init <directory>
git init --bare <directory>
git clone <repo>
git clone <repo> <direc...
GIT Branch Management
Master branch keep untouched
To maintain stability
To build without error
8
Need for Branching ?
Bra...
GIT Branch Management
git branch
git branch <branch>
git branch -d <branch>
git branch -D <branch>
git branch -m <branch>
...
GIT Branch Management
98ca9 34ac3 f30ab
master
feature
HEAD
$ git branch feature
10
GIT Branch Management
98ca9 34ac3 f30ab
master
feature
HEAD
98ca9 34ac3 f30ab
master
HEAD
ws4y
feature
$ git checkout feat...
GIT Staging Area
12
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
Add file
Remove file
Edit file
Stage fileU...
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
git add <file>
git reset <file>
Garbage
Ne...
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
Edit file
git checkout <file>
Garbage
git ...
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
git add <file>git reset <file>
git reset
G...
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
git commit -m <message>
Garbage
# You can ...
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
Garbage
# Reset stage area and keep worksp...
File Status Life cycle
Untracked
Tracked &
Unmodified
Modified
Staged
Committed
Garbage
New file
git clean -f
# Delete cha...
Reset vs Revert
commit
BP
H
BP
H
NC
reset
BP
H
revert
Y
BP
H
Y
20
Git Status
21
Untracked
Tracked &
Modified Staged
Git Status
(brnchA ) $ git status
# on branch branchA
# changes to be committed :
# (use “git reset HEAD <file>…” to unsta...
Merging
23
Merging mechanisms
Fast forward merging
Tree way merging
Rebase
Merging Mechanisms: Fast-forward
98ca9 34ac3 f30ab
master
d45th
branchA
d45th98ca9 34ac3 f30ab
master
branchA
$ git checko...
Merging Mechanisms: 3 way
98ca9 34ac3 f30ab
master
d45th
branchA
sd235 1w34t
d45th
98ca9 34ac3 f30ab
master
branchA
sd235 ...
Merging Mechanisms : Rebase
98ca9 34ac3 f30ab
master
d45th
branchA
sd235
98ca9 34ac3 f30ab
master
d45th
sd235
branchA
sd23...
Merging Scenarios: Cherry Pick
98ca9 34ac3 f30ab
master
d45th
branchA
sd235 1w34t
$ git checkout master
$ git cherry-pick ...
Git Commands - remote
git remote
git remote –v
git remote add <name> <url>
git remote rm <name>
git remote rename <old-nam...
Git Commands - fetch
git fetch <remote>
git fetch <remote> <branch>
$ git branch -r
# origin/master
# origin/develop
# ori...
Git Commands - pull
git pull <remote> (git fetch + git merge)
git pull --rebase <remote> (git fetch + git rebase)
$ git ch...
Git Commands - push
git push <remote> <branch>
git push <remote> --force
git push <remote> --all
git push <remote> --tags
...
Work Flow Summary
Workspace Staging Area Local Repo Remote Repoinit
clone
pull
fetch
add
commit
push
commit
reset
reset
re...
Workflow in Command line
$ git clone https://github.com/vimukthir/gitTutorial.git
project1
$ cd project1
$ git branch
$ *m...
Workflow in Command line
$ git status
on branch branchA
#(use “git add <file>…” to update what will be committed)
#(use “g...
Workflow in Command line
$ git checkout master
S git merge branchA
Auto merging Test.java
CONFLICT (content): Merge confli...
Git Commands - log
git log
git log -n <limit>
git log –oneline
git log –stat
git log –p
git log --author="<pattern>“
git l...
Git Commands - config
git config --global user.name <name>
git config --global user.email <email>
git config --global alia...
Git Commands -Interactive Staging
38
Git Platform
Interactive Staging
status update revert patch diff add
Git Commands - Interactive Staging
Untracked
Tracked &
Unmodified
$ git add -i
staged unstaged path
1: unchanged +0/-1 Tes...
Git Commands -Interactive Patch
40
Workspace
1 2
3 4
2
4 4
Staging Area
Git Commands -Interactive Patch
Untracked
Tracked &
Unmodified
$ git add -p
diff –git Test.java
Index d26b0bd—93a2695 1006...
Git Commands - stash
git stash
git stash apply
git stash apply {stash_id}
git stash list
git stash branch stashBranch
$ gi...
Git Commands - log
$
$ git stash
Saved working directory and index state 
"WIP on master: 049d078 added the Test.java"
HEA...
Git Commands - stash
44
Workspace
Staging Area
Stash
BranchA
git stash
git apply
Workspace
Staging Area
StashBranch
git ap...
Git Commands - web
git instaweb
Web support
45
Commands Comparison (Git/SVN)
46
Git SVN
git clone <repo> svn checkout url
git pull svn update
git init
git add .
git comm...
Commands Comparison (Git/SVN)
47
Git SVN
git commit -a svn commit
git branch branch
git checkout branch
svn copy <source> ...
Git Workflows
48
Forking
Git flow
Feature Branch
Centralized
Github repo
Git remote repository
49
https://github.com
Git Architecture
50
.git
branches
hooks
info
logs
objects
refs
COMMIT_EDITMSG
config
description
HEAD
index
ORIG_HEAD
Cont...
Git Architecture
Git Objects
51
Object
Tree
Blob Commit
Tag
Git Architecture
How commit works
52
$ git commit Test.java Test1.java -m 'made a change’
blob
a906cb2a4a904a152e80877d408...
Git Architecture
How commit works
53
blob
a906cb2a4a904a152e80877d4088654daad0c859
blob
b456tb2a4a904a152e80877d4088654daa...
Git Architecture
How commit works
54
blob
a906cb2a4a904a152e80877d4088654daad0c859
blob
b456tb2a4a904a152e80877d4088654daa...
Git Architecture
55
commitcommitcommit
fdf4fc3344e67ab068f836878b6c4951e3b15f3d
cac0cab538b970a37ea1e769cbbde608743bc96d
1...
Git Architecture
56
$ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0
100644 blob a906cb2a4a904a152e80877d4088654...
$ find .git/objects -type f
.git/objects/01/55eb4229851634a0f03eb265b69f5a2d56f341 # tree 2
.git/objects/1a/410efbd13591db...
$ find .git/objects -type f
.git/objects/71/08f7ecb345ee9d0084193f147cdad4d2998293
.git/objects/d6/70460b4b4aece5915caf5c6...
GIT SVN Integration
• Fedora
• Ubuntu
• Windows
Using cygwin and install GIT via its package manager
59
$ yum install git-...
GIT SVN Integration
SVN Repo
Local
Master
Branch A
Branch B
Branch C
60
GIT SVN Integration
git svn clone <repo>
git svn clone <repo> <directory>
Download remote SVN repo to local machine
SVN Re...
GIT SVN Integration
git svn rebase
git svn dcommit
Applying changes to SVN repo
SVN Repo
Local Master
$ git svn clone
http...
Q & A
63
References
64
http://git-scm.com/
https://www.atlassian.com/git
http://git-scm.com/book
Merging Mechanisms : Rebase
98ca9 34ac3 f30ab
master
d45th
$ git rebase -i HEAD~3
65
98ca9 1qw34
master
Renaming License f...
Prochain SlideShare
Chargement dans…5
×

GIT_In_90_Minutes

471 vues

Publié le

  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

GIT_In_90_Minutes

  1. 1. Git in 90 Minutes 1By Vimukthi Randika
  2. 2. What’s GIT 2 Open source Version Control System Designed and developed by Linus Torvalds for Linux kernel GNU General Public License v2 Initial release, 7 April 2005 Last sable release 1.9, 14 Feb 2014 Written in C, Bourne Shell, Tcl, Perl For OSs, Linux, Windows, POSIX, OS X
  3. 3. Why GIT 3 Distributed Full control over local copy Fast and can be done offline Not have a single point of failure Adjustable workflows Standalone Collaboration Backups
  4. 4. Why GIT 4 Branching Frictionless context switching 1/3 s vs 13 s (GIT vs SVN) Enable parallel work Easy merging Lightweight
  5. 5. Why GIT 5 Staging Purified History Partial commits Logically separate change sets Edit commits
  6. 6. Workflow Remote Repo Local Master Branch A Branch B Branch C 6
  7. 7. Initializing Repository git init git init <directory> git init --bare <directory> git clone <repo> git clone <repo> <directory> Remote Repo Local Master $ git clone https://github.com/vimukthir/gitTutorial.git project1 7
  8. 8. GIT Branch Management Master branch keep untouched To maintain stability To build without error 8 Need for Branching ? Branch for each feature Bug fixing R&D Formulate workflow Centralized Feature Branch Git flow Forking
  9. 9. GIT Branch Management git branch git branch <branch> git branch -d <branch> git branch -D <branch> git branch -m <branch> Create branches git checkout <existing-branch> Switch branches Branch A Branch B Branch C Local Master $ git branch BranchA $ git checkout BranchA ------------------------- $ git checkout –b BranchA 9
  10. 10. GIT Branch Management 98ca9 34ac3 f30ab master feature HEAD $ git branch feature 10
  11. 11. GIT Branch Management 98ca9 34ac3 f30ab master feature HEAD 98ca9 34ac3 f30ab master HEAD ws4y feature $ git checkout feature $ git commit -a -m 'made a change’ 11
  12. 12. GIT Staging Area 12
  13. 13. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed Add file Remove file Edit file Stage fileUn-stage file Revert edit file Revert commit Commit file Commit file Garbage New file Revert commit Send to Garbage Revert changes 13 Add file
  14. 14. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed git add <file> git reset <file> Garbage New file git add <file> git add <directory> git add –p git reset <file> $ git add Test.java $ git reset Test.java 14
  15. 15. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed Edit file git checkout <file> Garbage git checkout <file> # Doing some modifications to Test.java and # you need to revert all the changes $ git checkout Test.java 15
  16. 16. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed git add <file>git reset <file> git reset Garbage git reset --hard git add -p git reset <file> git add -i git reset git add <file> # Test.java is already tracked file and we # need to add it to stage area after Doing # some modifications. $ git add Test.java # Now you want to remove it from stage area $ git reset Test.java # Or we want to throw all the changes in the # stage area to the garbage $ git reset --hard git reset --hard 16
  17. 17. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed git commit -m <message> Garbage # You can commit the Test.java either from stage area or un-stage area. $ git commit Test.java –m “Adding Test file” git commit git commit -m "<message>" git commit –a git commit --amend git commit --amend --no-edit 17 git commit git commit <file> -m <message> git commit -a
  18. 18. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed Garbage # Reset stage area and keep workspace untouched $ git reset HEAD~1 # Reset both stage area and workspace $ git reset –-hard HEAD~1 git reset HEAD~1 git reset --hard HEAD~1 git revert HEAD # Revert both stage # area and workspace $ git revert HEAD~1 18
  19. 19. File Status Life cycle Untracked Tracked & Unmodified Modified Staged Committed Garbage New file git clean -f # Delete changes which haven’t added to stage area $ git clean -f 19
  20. 20. Reset vs Revert commit BP H BP H NC reset BP H revert Y BP H Y 20
  21. 21. Git Status 21 Untracked Tracked & Modified Staged
  22. 22. Git Status (brnchA ) $ git status # on branch branchA # changes to be committed : # (use “git reset HEAD <file>…” to unstage) # # modified : Test1.java # deleted : Test2.java # new file : README # # 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 : Test3.java # # untracked files : # (use “git add <file>…” to include in what will be committed) # # spring.properties 22
  23. 23. Merging 23 Merging mechanisms Fast forward merging Tree way merging Rebase
  24. 24. Merging Mechanisms: Fast-forward 98ca9 34ac3 f30ab master d45th branchA d45th98ca9 34ac3 f30ab master branchA $ git checkout master $ git merge branchA Updating f30ab ..d45th Fast-forward Test.java | - 1 file changed, 1, deletion(-) git merge <branch> git merge --no-ff <branch> 24
  25. 25. Merging Mechanisms: 3 way 98ca9 34ac3 f30ab master d45th branchA sd235 1w34t d45th 98ca9 34ac3 f30ab master branchA sd235 1w34t rt12u $ git checkout master $ git merge branchA Auto-merging Test.java Merge made by the ‘recursive’ strategy Test.jsva | 1 + 1 file changed, 1 insertion(+) 25
  26. 26. Merging Mechanisms : Rebase 98ca9 34ac3 f30ab master d45th branchA sd235 98ca9 34ac3 f30ab master d45th sd235 branchA sd235 $ git checkout branchA $ git rebase master First, rewinding head to replay your work on top of it... Fast-forwarded branch2 to master. 26
  27. 27. Merging Scenarios: Cherry Pick 98ca9 34ac3 f30ab master d45th branchA sd235 1w34t $ git checkout master $ git cherry-pick sd235 27 98ca9 34ac3 f30ab master d45th branchA sd235 1w34t rt56h (sd235) $ git cherry-pick sd235..1w34t
  28. 28. Git Commands - remote git remote git remote –v git remote add <name> <url> git remote rm <name> git remote rename <old-name> <new-name> # Adding remote connection to the specified address. This connection can be reffered as “john” $ git init $ git remote add john http://dev.example.com/john.git $ git clone john 28
  29. 29. Git Commands - fetch git fetch <remote> git fetch <remote> <branch> $ git branch -r # origin/master # origin/develop # origin/some-feature $ git fetch origin a1e8fb5..45e66a4 master -> origin/master a1e8fb5..9e8ab1c develop -> origin/develop * [new branch] some-feature -> origin/some-feature $ git checkout master $ git merge origin/master 29
  30. 30. Git Commands - pull git pull <remote> (git fetch + git merge) git pull --rebase <remote> (git fetch + git rebase) $ git checkout master $ git pull --rebase origin 30
  31. 31. Git Commands - push git push <remote> <branch> git push <remote> --force git push <remote> --all git push <remote> --tags $ git checkout master $ git fetch origin master $ git rebase -i origin/master # Squash commits, fix up commit messages etc. $ git push origin master 31 Always push to bear repositories Bear repositories can be initialize with “git init -- bear” command What special with bear repo is it doesn’t have workspace
  32. 32. Work Flow Summary Workspace Staging Area Local Repo Remote Repoinit clone pull fetch add commit push commit reset reset revert reset initialize update rebase merge changes revert dcommit 32
  33. 33. Workflow in Command line $ git clone https://github.com/vimukthir/gitTutorial.git project1 $ cd project1 $ git branch $ *master $ git branch –b feature1 $ git branch $ *mater $ feature1 $ git checkout feature1 $ git branch $ master $ *feature1 33
  34. 34. Workflow in Command line $ git status on branch branchA #(use “git add <file>…” to update what will be committed) #(use “git -- checkout <file>” to discard changes in working directory) # # modified : Test.java $ git add Test.java S git status # on branch branchA # changes to be committed : # (use “git reset HEAD <file>…” to unstage) # new file : Test.java $ git commit Test.java 34
  35. 35. Workflow in Command line $ git checkout master S git merge branchA Auto merging Test.java CONFLICT (content): Merge conflict in Test.java Automatic merge failed; fix conflicts and then commit the result. <<<<<<<< HEAD public void doTest() { ============== public void test() { >>>>>>>> branchA $ git add Test.java $ git commit Test.java –m “Resolving conflicts” $ git rebase origin master $ git push 35
  36. 36. Git Commands - log git log git log -n <limit> git log –oneline git log –stat git log –p git log --author="<pattern>“ git log --grep="<pattern>“ git log <since>..<until> git log <file> git log --graph --decorate --oneline Workspace Staging Area Local Repo Git log 36 Git diff --cached Git diff --staged Git status Git diff HEAD
  37. 37. Git Commands - config git config --global user.name <name> git config --global user.email <email> git config --global alias.<alias-name> <git-command> Changing local repo configuration # Add some SVN-like aliases git config --global alias.st status git config --global alias.co checkout git config --global alias.br branch git config --global alias.up rebase git config --global alias.ci commit 37
  38. 38. Git Commands -Interactive Staging 38 Git Platform Interactive Staging status update revert patch diff add
  39. 39. Git Commands - Interactive Staging Untracked Tracked & Unmodified $ git add -i staged unstaged path 1: unchanged +0/-1 Test.java 2: unchanged +1/-1 Test1.java *** Commands *** 1: status 2: update 3: revert 4: add untracked 5: patch 6: diff 7: quit 8: help What now> 39 What now> 2 staged unstaged path 1: unchanged +0/-1 Test.java 2: unchanged +1/-1 Test1.java Update>> Update>> 2 staged unstaged path 1: unchanged +0/-1 Test.java * 2: unchanged +1/-1 Test1.java Update>>
  40. 40. Git Commands -Interactive Patch 40 Workspace 1 2 3 4 2 4 4 Staging Area
  41. 41. Git Commands -Interactive Patch Untracked Tracked & Unmodified $ git add -p diff –git Test.java Index d26b0bd—93a2695 100644 --- a/Test.java +++ b/Test.java @@-8.7 +8,7 package Test; public class Test { + public void method1() { + } + public void method2() { + } } Stage this hunk [y,n,q,a,d,/,e,?]? 41
  42. 42. Git Commands - stash git stash git stash apply git stash apply {stash_id} git stash list git stash branch stashBranch $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: Test.java # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # # modified: Test1.java 42
  43. 43. Git Commands - log $ $ git stash Saved working directory and index state "WIP on master: 049d078 added the Test.java" HEAD is now at 049d078 added the Test.java (To restore them type "git stash apply") $ git status # On branch master nothing to commit (working directory clean) $ git stash list stash@{0}: WIP on master: 049d078 added the Test.java $ git stash apply # On branch master # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # # modified: Test.java # modified: Test1.java Git Commands - stash 43
  44. 44. Git Commands - stash 44 Workspace Staging Area Stash BranchA git stash git apply Workspace Staging Area StashBranch git apply <StashBranch>
  45. 45. Git Commands - web git instaweb Web support 45
  46. 46. Commands Comparison (Git/SVN) 46 Git SVN git clone <repo> svn checkout url git pull svn update git init git add . git commit svnadmin create repo svn import file://repo git diff rev path svn diff -rrev path git apply patch -p0 git status svn status git checkout path svn revert path git add file git rm file git mv file svn add file svn rm file svn mv file
  47. 47. Commands Comparison (Git/SVN) 47 Git SVN git commit -a svn commit git branch branch git checkout branch svn copy <source> <destination> svn switch <destination> git branch svn list http://example.com/svn/branches/ git merge branch svn merge -r R1:R2 <source>
  48. 48. Git Workflows 48 Forking Git flow Feature Branch Centralized
  49. 49. Github repo Git remote repository 49 https://github.com
  50. 50. Git Architecture 50 .git branches hooks info logs objects refs COMMIT_EDITMSG config description HEAD index ORIG_HEAD Contains a set of shell scripts which executes after user commands Store blob, Tree, commit & tag Store heads, remotes & tags Keep track of current branch in workspace Keep track of staged changes Store user defined configurations
  51. 51. Git Architecture Git Objects 51 Object Tree Blob Commit Tag
  52. 52. Git Architecture How commit works 52 $ git commit Test.java Test1.java -m 'made a change’ blob a906cb2a4a904a152e80877d4088654daad0c859 Test.java blob b456tb2a4a904a152e80877d4088654daad0c843 Test1.java Path to Object = .git / a9 / 06cb2a4a904a152e80877d4088654daad0c859
  53. 53. Git Architecture How commit works 53 blob a906cb2a4a904a152e80877d4088654daad0c859 blob b456tb2a4a904a152e80877d4088654daad0c843 tree 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0
  54. 54. Git Architecture How commit works 54 blob a906cb2a4a904a152e80877d4088654daad0c859 blob b456tb2a4a904a152e80877d4088654daad0c843 tree 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 commit fdf4fc3344e67ab068f836878b6c4951e3b15f3d
  55. 55. Git Architecture 55 commitcommitcommit fdf4fc3344e67ab068f836878b6c4951e3b15f3d cac0cab538b970a37ea1e769cbbde608743bc96d 1a410efbd13591db07496601ebc7a059dd55cfe9 C C C T B B T B T T T T HEAD
  56. 56. Git Architecture 56 $ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 100644 blob a906cb2a4a904a152e80877d4088654daad0c859 Test.java 100644 blob b456tb2a4a904a152e80877d4088654daad0c843 Test1.java $ git cat-file -p a906cb2a4a904a152e80877d4088654daad0c859 public class Test { String arg … } $ git cat-file -p fdf4fc3344e67ab068f836878b6c4951e3b15f3d tree 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0 author Vimukthi Randika <vimukthi@gmail.com> 1243040974 -0700 committer Vimukthi Randika <vimukthi@gmail.com > 1243040974 -0700 first commit
  57. 57. $ find .git/objects -type f .git/objects/01/55eb4229851634a0f03eb265b69f5a2d56f341 # tree 2 .git/objects/1a/410efbd13591db07496601ebc7a059dd55cfe9 # commit 3 .git/objects/1f/7a7a472abf3dd9643fd615f6da379c4acb3e3a # test.txt v2 .git/objects/3c/4e9cd789d88d8d89c1073707c3585e41b0e614 # tree 3 .git/objects/83/baae61804e65cc73a7201a7252750c76066a30 # test.txt v1 .git/objects/95/85191f37f7b0fb9444f35a9bf50de191beadc2 # tag .git/objects/ca/c0cab538b970a37ea1e769cbbde608743bc96d # commit 2 .git/objects/d6/70460b4b4aece5915caf5c68d12f560a9fe3e4 # 'test content' .git/objects/d8/329fc1cc938780ffdd9f94e0d364e0ea74f579 # tree 1 .git/objects/fa/49b077972391ad58037050f2a75f74e3671e92 # new.txt .git/objects/fd/f4fc3344e67ab068f836878b6c4951e3b15f3d # commit 1 $ git gc Counting objects: 17, done. Delta compression using 2 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (17/17), done. Total 17 (delta 1), reused 10 (delta 0 Git Commands - pack 57
  58. 58. $ find .git/objects -type f .git/objects/71/08f7ecb345ee9d0084193f147cdad4d2998293 .git/objects/d6/70460b4b4aece5915caf5c68d12f560a9fe3e4 .git/objects/info/packs .git/objects/pack/pack-7a16e4488ae40c7d2bc56ea2bd43e25212a66c45.idx .git/objects/pack/pack-7a16e4488ae40c7d2bc56ea2bd43e25212a66c45.pack Git Commands - pack 58 O1 O2 O3 O4 commit flows ∆1 ∆2 ∆3 git gc O4∆3∆2∆1
  59. 59. GIT SVN Integration • Fedora • Ubuntu • Windows Using cygwin and install GIT via its package manager 59 $ yum install git-svn $ apt-get install git-svn Installation
  60. 60. GIT SVN Integration SVN Repo Local Master Branch A Branch B Branch C 60
  61. 61. GIT SVN Integration git svn clone <repo> git svn clone <repo> <directory> Download remote SVN repo to local machine SVN Repo Local Master $ git svn clone http://selene.aepona.com/internal/services/bdd- testsuit/trunk bdd-testsuit 61
  62. 62. GIT SVN Integration git svn rebase git svn dcommit Applying changes to SVN repo SVN Repo Local Master $ git svn clone http://selene.aepona.com/internal/services/bdd - testsuit/trunk bdd-testsuit # Making branches, adding, commiting, merging $ git svn rebase $ git svn dcommit 62
  63. 63. Q & A 63
  64. 64. References 64 http://git-scm.com/ https://www.atlassian.com/git http://git-scm.com/book
  65. 65. Merging Mechanisms : Rebase 98ca9 34ac3 f30ab master d45th $ git rebase -i HEAD~3 65 98ca9 1qw34 master Renaming License folder Moving Licenses different folder Adding Licenses origin/HEAD origin/master Adding license to separate folder origin/HEAD origin/master

×