Lab – 5
Aim: Using Git-Bash environment to create repository and stage a file with performing commits
Description:
1. Installing Git in Local System?
Visit the web site [Link]
choose 64-bit Git for Windows setup
Run the setup file
Select next until entire setup process completes
If you need startup icon or runtime icon you can select checkboxes else left them unselect
After completion of installation
Git BASH console opened on screen as follows
2. Creating Environment for Git-Local?
set environmental path for GIT
type advanced system settings in search box
select <Environment Variables> button
select <New> button
Give a Name like "GITBash" in Variable Name
set Variable path as given below
"C:\Users\INTERNET\AppData\Local\Programs\Git\[Link]"
3. Creating your Identity in GIT?
$ git config --global [Link] "Dr BVRK"
$ git config --global [Link] "123342"
$ git config --global [Link] “bhvram78@[Link]”
$ git config [Link]
Dr BVRK
$ git config [Link]
bhvram78@[Link]
$ git config [Link]
Dr B.V. Rama Krishna Associate Professor (CSE)
123342
4. Create a new local repository in any folder?
$ git init
Initialized empty Git repository in E:/MYGitFiles/.git/
5. Stage files into repository created?
$ git add .
SamhiSesi@DESKTOP-F7HHS75 MINGW64 /e/mygitfiles (master)
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: [Link]
new file: [Link]
6. Perform commit over staged documents
$ git commit -m "Performing Commit 002"
[master (root-commit) 28d6b76] Performing Commit 002
2 files changed, 16 insertions(+)
create mode 100644 [Link]
create mode 100644 [Link]
7. Performing un commit last operations
$ git reset --soft HEAD
SamhiSesi@DESKTOP-F7HHS75 MINGW64 /e/mygitfiles (master)
$ git status
On branch master
nothing to commit, working tree clean
SamhiSesi@DESKTOP-F7HHS75 MINGW64 /e/mygitfiles (master)
$ git reset HEAD
SamhiSesi@DESKTOP-F7HHS75 MINGW64 /e/mygitfiles (master)
$ git status
On branch master
nothing to commit, working tree clean
SamhiSesi@DESKTOP-F7HHS75 MINGW64 /e/mygitfiles (master)
$ ls
[Link] [Link]
Dr B.V. Rama Krishna Associate Professor (CSE)