DevOps Classroom notes 19/Nov/2023

Git Contd

Git Remote Repository

  • Fourth area of git
    Preview
  • A git local repository can connect to multiple remote repositories
  • Each remote repository will have a name, by default when we perform clone operation, the name of remote is origin
  • Clone gets a copy of remote into local repository
  • in your local repo we will a branch called as main where we can work and in addition to this a branch will be created called as origin/main which represents the remote repo
  • Condition: When we are sending commits to remote repo. The latest commit id on origin/main and actual remote should be same
    Preview
  • PUll = Fetch + Merge
  • To get remote changes without adding extra commits prefer git pull --rebase
  • upstream: Default remote repository
  • GitHub Repo:

    • SSH Configuration: Settings => Ssh keys => Add a new ssh key
  • We have understood how to work on multiple remotes

Explain

  • Git clone vs pull
  • Git pull vs pull –rebase
  • Git bare repository
  • Git mirror
  • Forking in Github

Activities

  • Configure your github account to use ssh key of your laptop
  • Create a local git repo called as notes and push it to github private repo called as notes in your account.
  • Create a new repository in github called as hello-remote
    • Explain git pull vs git pull –rebase
    • push a new branch
  • Create a linux vm and install git and ensure you have done atleast 10 questions before next session Refer Here

Jenkins installation

  • Install jdk 17
sudo apt update
sudo apt install openjdk-17-jdk -y
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins -y
  • Jenkins runs on port 8080 by default
  • Once we install jenkins a user called as jenkins is created
  • Navigate to http://<public-ip>:8080
  • Enter the initialAdmin password
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  • Install selected plugins
  • Create a admin user
    Preview

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

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

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

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