Commandes Linux : git merge

GIT MERGE

 

 

Fusionner une branche avec une autre :

Ceci crée un nouveau commit de fusion.

$ git checkout branchname1
$ git merge branchname2

ex :

$ git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %ad | %s%d [%C(bold blue)%an%Creset]' --graph --date=short --all
* c570971 - (master) 2018-06-18 | Added README (master) [darwinos]
| * 28917a4 - (HEAD -> greet) 2013-04-13 | Updated Rakefile (HEAD -> greet) [darwinos]
| * 4dac415 - 2013-04-13 | Hello uses Greeter [darwinos]
| * 39347b3 - 2013-04-13 | Added greeter class [darwinos]
|/  
* 96ee164 - 2013-04-13 | Added a Rakefile. [darwinos]
$ git checkout master
Basculement sur la branche 'master'
$ git merge greet
Merge made by the 'recursive' strategy.
 Rakefile       | 2 +-
 lib/greeter.rb | 8 ++++++++
 lib/hello.rb   | 6 ++++--
 3 files changed, 13 insertions(+), 3 deletions(-)
 create mode 100644 lib/greeter.rb
$ git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %ad | %s%d [%C(bold blue)%an%Creset]' --graph --date=short --all
*   6a31e2c - (HEAD -> master) 2018-06-18 | Merge branch 'greet' (HEAD -> master) [darwinos]
|\  
| * 28917a4 - (greet) 2013-04-13 | Updated Rakefile (greet) [darwinos]
| * 4dac415 - 2013-04-13 | Hello uses Greeter [darwinos]
| * 39347b3 - 2013-04-13 | Added greeter class [darwinos]
* | c570971 - 2018-06-18 | Added README [darwinos]
|/  
* 96ee164 - 2013-04-13 | Added a Rakefile. [darwinos]

 

Fermer le menu
%d blogueurs aiment cette page :