Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Git commands

lab@KCSKNC-SYS-50 MINGW64 ~
$ pwd
/c/Users/lab

lab@KCSKNC-SYS-50 MINGW64 ~
$ cd /d

lab@KCSKNC-SYS-50 MINGW64 /d
$ mkdir flower

lab@KCSKNC-SYS-50 MINGW64 /d
$ cd flower

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ touch ex1.txt

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ touch ex1.py

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ touch ex2.txt

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ echo " Sunflower "> ex1.txt

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ git config -- global user.name "bca"
fatal: not in a git directory

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ git config -- global user.email "bca@gmail.com"

lab@KCSKNC-SYS-50 MINGW64 /d/flower


$ git init
Initialized empty Git repository in D:/flower/.git/

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git add ex1.txt
warning: in the working copy of 'ex1.txt', LF will be replaced by CRLF the next time Git touches
it

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git add ex2.txt
lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)
$ git add ex1.py

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git status
On branch master

No commits yet

Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: ex1.py
new file: ex1.txt
new file: ex2.txt

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git status
On branch master
nothing to commit, working tree clean

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git commit -m"first commit"
On branch master
nothing to commit, working tree clean

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git status
On branch master
nothing to commit, working tree clean

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git log --oneline
301a3e8 (HEAD -> master) first commit

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$ git show 301a3e8:ex1.txt
Sunflower

lab@KCSKNC-SYS-50 MINGW64 /d/flower (master)


$

You might also like