Module 1 Exercise 1: Git basics


(Mihaela Sabin) #274

Completed Module 1

mcs_admin campus-advisors $ git init demo
Initialized empty Git repository in /Users/mcs_admin/learngit/campus-advisors/demo/.git/
mcs_admin campus-advisors $ cd demo
mcs_admin (master #) demo $ touch readme.md
mcs_admin (master #) demo $ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	readme.md

nothing added to commit but untracked files present (use "git add" to track)
mcs_admin (master #) demo $ git add readme.md
mcs_admin (master +) demo $ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   readme.md

mcs_admin (master +) demo $ git reset readme.md
mcs_admin (master #) demo $ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	readme.md

nothing added to commit but untracked files present (use "git add" to track)
mcs_admin (master #) demo $ git add readme.md
mcs_admin (master +) demo $ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

	new file:   readme.md

mcs_admin (master +) demo $ git commit -m 'commit empty readme'
[master (root-commit) ceda973] commit empty readme
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 readme.md

(João da Mata) #275


This is my exercise 1.1


(Abhishek Prasad) #276


(Itsmeashutosh43) #278

Hello! Here is my git screenshot!


(Sufiankaki) #279


(Jake Hobbs) #280

Bingo! (Had a nightmare early on with putting readme in wrong directory


(Kestie77) #281

33%20AM


(Stéphane Lopes) #282

Module-1-Basics-Done


(Raja Kushalnagar) #283


(Dirk Uys) #284

@erikerhardt looks good. Instead of ls -la, you can use git status to see what git things is going on :slight_smile:


(Dirk Uys) #285

Hi @Chelly242, looks good. Check what happens between git add and git reset using git status.


(Dirk Uys) #286

Hi @Beethovenw - looks good. Glad you figured out what went wrong in the start! Run git status between a git add and git reset to see how the commands affect your staging area.


(Dirk Uys) #287

@bhantsi - :+1: all good. Try running git status in between commands to see how your staging and working areas are affected.


(Dirk Uys) #288

@aammeloot :100:!


(Dirk Uys) #289

Hi @mrmirah - looks like you did a bit more than just the exercise :raised_hand_with_fingers_splayed:! Are you comfortable using git init, git add, git status and git reset? If you don’t mind, could you please post a screenshot of those steps?


(Dirk Uys) #290

@rb-dahlb :dart: well done


(Dirk Uys) #291

@donbstringham steps are good :+1:. Maybe run a few git statuses in between to see what Git thinks is happening :slight_smile:

Nice terminal setup!


(Dirk Uys) #292

@sauravjaiswalsj - looks good! Try running git status in between to see the effects.


(Dirk Uys) #293

@grammaton - like the confidence :slight_smile: Maybe sprinkle a few git status-es in there to see what git is thinking.


(Dirk Uys) #294

@ConsoleFriend - that’s perfect!