A Guide to Git & GitHub

In this course we will be learning about version control especially Git and GitHub which provides hosting for Git version control.

Staging and committing

Let’s stage the change we made to index.html file.

git add is a multipurpose command — you use it to begin tracking new files, to stage files, and to do other things like marking merge-conflicted files as resolved.

Let’s run git add now to stage the index.html file, and then run git status again:

$ git add index.html
$ git status
On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
 modified:   index.html

The file is staged and will go into your next commit.

Now let's run the git commit command,

$ git commit -m "make university awesome"
[master 7f0f66a] make university awesome
 1 file changed, 1 insertion(+), 1 deletion(-)

If you run git status command again you should see,

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

The working directory is clean and ready for you to continue.
Previous Next

Unlock Your Potential with Engineeous

Get Started