22MCC20067 WS1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Experiment No. 1.

Student Name: Neeraj Kukreti UID: 22MCC20067


Branch: MCA–CCD Section/Group: MCD-1/A
Semester: 4 Date of Performance: 18th Jan 24
Subject Name: Continuous Integration Subject Code: 22CAP-745
/ Continuous Delivery

1. Aim/Overview of the practical:


a) Install and setup git in your Systems.

b) Create a python file named as your UID (eg.22MCC20001.py) with some code inside it on a
Local Repository named as your UID (e.g. 22MCC20001). Push this file on Remote Repo.

c) Create another Local Repository named as your name (e.g. ABC) and pull the files from Remote
Repo in it. After this, create a new file in new Local Repo i.e. ABC and push it to Remote Repo.
Again, pull the files on old Local Repo i.e. 22MCC20001.

d) At last, visit Remote Repo and commit some changes in a file created i.e. 22MCC20001.py and
pull the file again in new Local Repo i.e. ABC. Check whether the changes are existing in file in
Local Repo or not.

2. Code for practical: (a)


Step 1 : To install Git, you can use winget package manager on windows.
e.g, winget install -e --id Git.Git

Step 2 : After successful installation configure Git using git config command.
e.g, git config --global user.name "neerajkukreti357" and
git config --global user.email [email protected]

Code for practical: (b)


Step 1 : Open terminal and create a folder with your name with the help of mkdir command.
Step 2 : Change directory to above created folder using cd 22MCC20067.
Step 3 : Create a new 22MCC20067.py file.

Step 4 : Initialize git using git init.


Step 5 : Now create a new main branch using git branch -M main.
Step 6 : After that add file to staging arear of git using git add 22MCC20067.py
Step 7 : Commit changes using git commit -m “Message”.
Step 8 : After that open Github.com and create new remote GitHub repository.
Step 9 : After that link your remote and local repository together using git remote add origin
<remote_repository_link>.

Step 10 : Now push local repository to remote repository using git push -u origin main.
Code for practical: (c)
Step 1 : Create another folder named 22MCC20067 using mkdir command.
Step 2 : To pull from GitHub repository initialize empty git repository using git init command.
Step 3 : After that link remote repository to the local repository using git remote add origin
<remote_repository_link>.
Step 4 : Now you can pull from remote repository using git pull origin main.

Step 5 : Now create a new file and add it on git staging area using git add 22MCC20067.py
command.
Step 6 : Commit changes using git commit -m “Message”.
Step 7 : To push new changes to remote repository, use git using git push -u origin main.
Step 8 : To pull the new changes to the old local repository use git pull origin main command.

Code for practical: (d)


Step 1 : Goto remote repository on GitHub and create new file and commit the changes.
Step 2 : To pull the changes made on remote repository to the local repository use git pull origin
main.
Step 3 : The above command will fetch all the new updates to local repository and to verify if the
file is present on the local repository or not you can use ls command to list all the content of
current folder and verify if file is there or not.

You might also like