DevOps Classroom series – 02/May/2020

Background:

  • For all of the demonstrations in this series, consider you have two developers and one remote repo hosted in github

Scenarios for Merge-Conflict

  1. Developer A is Creating the basic structure of project. This project uses python django and angularjs. so the basic folder will be the first commit Refer Here

  2. Devloper B gets the latest version

  3. Both Developer A and Developer B are working on Same files and they decide to update the remote repository

  4. Developer B pushes the code to Remote Repository

  5. Devloper A push will fail, he needs to get the latest version and when he tries to pull he gets merge conflict

  6. Fix the code to be right

  7. Add the changes and execute git commit now developer A can push changes

Scenario: Mutliple Branches

  • QT decided to work on two version parallelly along with main development branch master
    • release-a (apollo hospitals)
    • release-b (continental hospitals)
  • To do this we use branches in git
  • Our branches will be as shown below
  • To create a branch
git branch <branch-name>
  • To Create the branch and move the head to new branch
git checkout -b branch
  • To view all the branches
git branch
  • To push the branches to the remote repository
git push <remote> <branch>

  • Now if the developer B pulls the code he gets all the commits and also branches

Git – Merge

  • Normal Merge

  • Fast-Forward Merge:

    • Now you want to merge the changes from release-C to master and master has not changed at all, creating a new commit will not be required and git just moves the master branches pointer to the latest commit ID on release -C
    • note: If you dont want fastforward do merge with git merge --no-ff <branch>

Git – Rebase

  • Images

  • Commands

  • Interactive Rebase is also used to change the history of local commits

Git-Cherry Pick

Git Topics To be Covered Post Jenkins

  • Git Protocols
  • Git Hooks
  • Branching Strategies
  • Forking in Git Repositories
  • Git Bare repositories
  • making changes in history using interactive rebase
  • Git Stash

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%