Git Contd
Git Remote Repository
-
Fourth area of git
-
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

- 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
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

Like this:
Like Loading...