Skip to content

jhonsanchez/branch-merge-rebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Objective

Practice merging techniques (merge vs rebase)

Exercise

Merge

  • Students fork the repository
  • Analyze each branch (commits, files, content)
    # Check main branch
    git switch main
    git log --oneline
    
    # Check lunch branch
    git switch lunch
    git log --oneline
    
    # Check dinner branch
    git switch dinner
    git log --oneline
    
    # Check dessert branch
    git switch dessert
    git log --oneline
    check all branches at once
    git log --oneline --all --graph
  • Go to main-merge branch
    git switch main-merge
  • Perform a simple merge from the lunch branch
    git merge lunch
  • Review the merge result
  • Perform a merge using the --no-commit option
    git merge --no-commit dinner
  • Review the result of the new merge
    git status
    git log --oneline    
  • What's the difference between the two merges?
    git commit -am"Merge with dinner with --no-commit option"

Rebase

  • Students fork the repository
  • Analyze each branch (commits, files, content)
  • Perform a rebase in the dessert branch
    git switch dessert
    git log --oneline
    git rebase main-merge
  • Review the rebase result
    git status
    git log --oneline    

Conclusions

Review results and differences, discuss appropriate scenarios for each case

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published