source_code_lab_record
source_code_lab_record
Computer
A computer is any device capable of performing calculations, whether they are
logical or mathematical.
Program/Code
A program (or code) is a set of instructions, often organised as an algorithm, that
directs a computer to perform a speci c task.
Version
A version in version control represents a snapshot of your project at a speci c
moment in time. This snapshot allows you to review, revert, or compare changes
made throughout the development process.
Page 1
fi
ff
fi
fi
fi
Lab Practical 1
1. Installing Git Using Homebrew
Step 1: Visit section 1.5 of pro git document and navigate to macOS section
• Command:
Page 2
Step 3: Install Git Using Homebrew:
Page 3
Step 4; Verify Git Installation:
Page 4
2. Basic CLI Commands
1) Command: ls
2) Command: date
Description: shows the current date and time in a standard format
3) Command: clear
Description: The clear command in the CLI is used to clear all the current text and output
displayed in the terminal window.
Page 5
fi
4) Command: time
Description: The time command in the CLI is used to measure the execution time of a command
or program.
5) Command: rm hello.txt
Description: Removes the le hello.txt from the current directory.
7)Command: cd Desktop
Description: Changes the current working directory to the Desktop directory.
8)Command: ls
Description: Lists all les and directories in the current directory.
Page 6
fi
fi
fi
3. Vim Text Editor
1) Command: vi hi.txt
Description: Opens (or creates) the le hi.txt in the Vim text editor.
Page 7
fi
3) Command: esc
Description: Used to exit insert mode
Page 8
4) Command: :wq
Description: Saves the changes and exits the Vim editor.
Page 9
4. Git Commands
1. Command: git - - version
Description:The git --version command is used to check the installed version of Git on
your system.
Page 10
fi
3.Command: git add testone.txt
Description: Adds testone.txt to the staging area in preparation for a commit.
Page 11
fi
fi
6.Command: git log
Description: Displays the commit history of the repository.
Page 12
fi
fi
10. Command git con g - - list
Page 13
fi
Lab Session 2: Git Commands
1. Command pwd
Description: returns the present working directory
2. Command ls
Description: lists all les and folders in the current directory
3. Command mkdir
Description: used to to make new directory/folder
4 .Command rmdir
Description: used to remove a directory
Page 14
fi
5. Command cd
Description: used to change current directory
6. Command cd ..
Description: used to exit the current sub directory
Page 15
Git commit
Step 1: create a le in the present working directory and add
content
Page 16
fi
fi
fi
fi
Step 5: commit the le to a local repository
Command ls-ah
Description: used to check hidden les in a directory
Page 17
fi
fi
fi
fi
Lab Session 3: Git Di
Mount Point
Point from where we can access the desired folder directly
/Users/ishritrai/Library/Mobile Documents/com~apple~CloudDocs/Amity/Git_Amity/Lab_2
Page 18
fi
fi
fi
fi
fi
ff
Task 1: make two commits in a directory
Step 2: use git add. Command to add both les in the staging
area
Page 19
fi
fi
fi
Step 5: use git log- - oneline for generating shorter commit id
Page 20
Task 2: compare two commits in a directory
Use git di along with the commit id generated from git log - -
online
Page 21
ff
Lab Session 4: practice git di
Page 22
ff
Lab Session 5 : git remote
Make 4 commits and compare them using git di
Page 23
f
Use git remote command to establish a connection between
local Git repository and a remote repository
Page 24
fi
Checking the commits made on GitHub account
Page 25
Lab Session 6 : git branching
Branch: pointer to a commit
Page 26
Git branch test_1: used to create branch with name test_1
Con rm the created branch by using git branch command to
view all the branches
Page 27
fi
Viewing the commits on a particular branch
Git pull is used to fetch and integrate changes which are in the
remote repository to local repository
Page 28
Git remote-v: used to view all remote repositories in a directory
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
Page 41
Page 42
Page 43
Page 44
Page 45
Page 46