DevOps Classroom series – 01/May/2020

Fourth Area of Git

  • To Collaborate between developers, we need code to be hosted Preview
  • Code can be hosted by any git server software/provider
    • Gitolite
    • GitHub
    • GitLab
    • BitBucket
    • Code Commit
    • Azure Source Repos
  • Git to manage this will have a fourth area called as remote-repo Preview
  • Sending the commits to the remote repo is called as push and getting the commits from the remote repository is called as pull.
  • If you don’t have a remote repository yet, but you have local repo then we would add a remote repository to local
  • If you have remote repository and you want that code to local system then we perform clone
  • Default Remote-repository will have a name which is origin Preview

Scenario: You have a local repo and now you have remote repository created and want to send all the changes to remote repo.

  • Connection between local and remote can be acheived by a command
git remote add --help # To know options
git remote add 

Preview Preview

Scenario: A New Developer wants to get the code from remote repository

  • In this case as mentioned earlier, we need to use clone
git clone <remote-url>

Preview Preview Preview

Scenario: Move all of the code from one repository to other repository

  • It is all about adding a new repository and pushing the changes from any developers machine
git remote add <newremote> <newremoteurl>
git push -u <newremote> <branch-name>

Preview

Scenario: Multi Developer UseCase

Preview

  1. Developer who is pushing the code to remote repository needs to be on latest version, so you have to do a pull before you push your changes.
    • Best Practice: Get Periodic Updates from remote using pull operations
    • Steps Preview Preview

Next Scenarios

  • Merge Conflicts
  • Multi Branches
  • Rebase
  • CherryPick
  • Tags

Leave a Reply

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

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers

Discover more from Direct DevOps from Quality Thought

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

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube