DevOps Classroom notes 24/Nov/2024

Git

Remote Repo

  • Connections and credentials:
    • https: use username/password or username/token as credentials
    • ssh: we use ssh keys generated on a system imported to remote repository
  • Import ssh into remote repositories

Clone vs Adding Remote

  • Clone is done when the remote is already available and in your system you donot have local repo. This creates a remote with name origin and upstream for default branch
git clone <remote-url>
  • We will be using remote add when we first create a local repo then remote repo or when moving the code from one repo to another
git remote add <name> <url>
Conditions
  • When sending changes to the remote repository the HEAD of the remote (origin/
    ) should exactly be same commit as present in the actual remote
PULL, PULL –rebase

Different types of clones

  • clone (Full clone): for working
    • working tree
    • local repo
  • bare clone: for hosting purposing
    • local repo
  • mirror clone: for backup purposes + mirroring
    • local repo + all references

Sending changes from local to remote (Enterprise)

  • Direct push
  • Feature branches:
    • Every change will lead to a branch
      • feature branches
      • defect branches
  • pull request (feature branches)

PULL REQUESTS WITHIN ORGANIZATION

  • This is used within enterprise

PULL REQUESTS OPEN SOURCE (Other organizations)

  • This is majorly used for opensource contributions
  • We will create a fork of the repository (copying the repo into your account)
  • create a feature branch and create a pull request
    • from feature branch of forked repo
    • to main branch of actual repo
  • Exercise: Create a Pull request to this repo
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Media Icons Powered by Acurax Web Design Company
Exit mobile version
%%footer%%