Professional Documents
Culture Documents
Git Guide
Git Guide
STEP ZERO
git init
STEP ZERO
git init
git add .
git add .
EXPERIMENT 3:
STEP ZERO
git init
//add contents to file
git add .
git commit -m “master commit”
// make changes
git stash save “message”
git add .
Create a folder and open it, right click and open git bash here
//if git url is given then use that, if not then go to browser, search github, log in, open one
repository( search some title ex: notes, and click open one note) copy the link from chrome
In git bash:
____________________________________________________________________________
EXPERIMENT 6: merge with message
STEP ZERO
git init
git add .
____________________________________________________________________________
STEP ZERO
git init
git log
//copy commit id from here, select the id, right click and copy
git tag tagname(ex: tagv1, v1, tagv1.0, anything) //creates a tag for the latest commit
OR
git tagname “paste commit id here” // to create a tag for a specific commit
//right click and paste
____________________________________________________________________________
EXPERIMENT 8:
STEP ZERO
git init
git add .
git log
// choose one commit id from the first and one commit id from the last (identify which is first and
last commit by referring to commit message otherwise will get confused, example i choose: third
commit and 5th commit)
____________________________________________________________________________
EXPERIMENT 9:
STEP ZERO
git init
git add .
git commit -m “message” //if possible make changes in file and make more commits, 3+ commit
git log
//copy commit id from here
METHOD 1: git show “paste commit id here” //no double quotes
OR
METHOD 2: git log -n 1 “paste commit id here” //no double quotes
____________________________________________________________________________
EXPERIMENT 10:
STEP ZERO
git config –global user.name “lekha”
git init
git add .
git commit -m “message” // make more changes in the file and commits
____________________________________________________________________________
EXPERIMENT 11:
STEP ZERO
git init
git add .
git log n
//n = number of commits you want to display, if you have made N commits, then the maximum
n<=N, ex: you made 6 commits, you can give n as 1,2,3,4,5,6 and not more. Choose any
number.