Module 1 Exercise 1: Git basics


(KrYounger) #627

image


(Jlennartz G) #628

jlennartz@JLDesktop MINGW64 ~
$ git init demo
Initialized empty Git repository in C:/Users/jlennartz/demo/.git/

jlennartz@JLDesktop MINGW64 ~
$ cd demo

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ touch readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git add readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git statud
git: ‘statud’ is not a git command. See ‘git --help’.

The most similar command is
status

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git status
On branch master

No commits yet

Changes to be committed:
(use “git rm --cached …” to unstage)

    new file:   readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git reset readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git status
On branch master

No commits yet

Untracked files:
(use “git add …” to include in what will be committed)

    readme.md

nothing added to commit but untracked files present (use “git add” to track)

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git add readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git status
On branch master

No commits yet

Changes to be committed:
(use “git rm --cached …” to unstage)

    new file:   readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git commit -m ‘commit empty readme’
[master (root-commit) f07fb33] commit empty readme
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 readme.md

jlennartz@JLDesktop MINGW64 ~/demo (master)
$ git status
On branch master
nothing to commit, working tree clean

jlennartz@JLDesktop MINGW64 ~/demo (master)


(Robert Foreman) #629


(JagCode) #630


(Andrew Miracle) #631


(Milinda Laknath Arambawela) #632


(Pol Benedito Momplet) #633


(Mahesh Jindal) #634

Steps To Creating an empy project named “demo” and making initial commit

  1. git init demo (cd into it)
  2. touch readme.md
  3. git add readme.md
  4. git reset readme.md // for resetting the added files to Staging Area
  5. git add readme.md (to get it back in the staging area)
  6. git commit -m ‘commit empty readme’

module_1_demo


(D Alger) #635

GitModule1


(Isg75) #636

Screenshot-2018-08-31-12-16-25


(Chris Cannon) #637

We’re here for the nifty :sparkles:


(Chris Cannon) #638

Looks good @CDNievas. Don’t forget you can use git status between your git add and git reset commands to see it’s effect on your staging area. :100:


(Mar Elv) #639


(Luís Guilherme Nascimento Maruccio) #640

Okay, it’s done.


(Lluisgarciapons) #641


(Amy Dickens) #642

Hey :wave: you seem to have missed out the git reset

would you mind resharing showing this stage? :sparkles:


(Amy Dickens) #643

Hey :wave:

Great to hear your happy to learn Git & GitHub - you’re in the right place! :blush:

You seem to be missing the git reset stage from your submission - would you mind adding a screenshot showing this? :sparkles:


(Amy Dickens) #644

Hey :wave:

It looks like your git commit didn’t contain any files as you forgot to re-add the readme.md using git add before the commit.

Would you mind adding the file and re-doing the commit to show us the result? :sparkles:


(Amy Dickens) #645

Hi Robert - great to have you here!

Let us know how you get on using Git & GitHub in your class. :sunny:


(Amy Dickens) #646

Hey :wave:

It looks like you’re missing the git reset readme.md stage from your submission.

Could you resubmit showing this? :sparkles: