Skip to content

Git and GitHub Tutorial for Beginners

Turtorial on Youtube.

Get Git

  1. Download at GIT-SCM.COM

https://git-scm.com

  1. Hit ‘Downloads’ alt text

  2. Select your operating system and then run through the installation process alt text

  3. With Git Installation, it came with a termianl called Git Bash.
    Launch Gitbash: Click on your Start menu and type in Git Bash

windows view: alt text

Once you’ve installed Git, you can use any terminal now to interact with Git. For this lesson, I am going to use Git Bash because it came with the Git installation on Windows. If you want, you could also download third party teminals like Hyper.is, which works across all different paltforms.

Use Git

  1. Git Configuration:
    To credit your identity, we need to specify your name and e-mail address:

git config --global user.name "type your name"

and then hit Enter, next set your e-mail address:

git config --global user.email yourEmail@xxxx.com

We need to set the default branch name:

git config --global init.default branch main

Ask for help

git config -h

Check Git-config Manual Page (no internet access required),check the descriptions of commands, the options of the commands, and etc.

git help config

Back to File Explorer , to clear the history and get a fresh view, type clear

To track files on your computer, first, change the current directory to the location of the file:

alt text

Back within Git Bash, cd change directory

alt text

Now, to turn this into a Git repository, type git init or git initialize

alt text

Now, if you click on ‘show hidden files’, you should see a .git file, which indicates that the file has been converted to a git repository.

alt text

Check the status of the repository: git status To track a specific file , type git add <file> To confirm a file being tracked, type git status again; To unstage(stop tracking) a tracked file, type git rm --cached <file>

Tips:
A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; An example of ignoring .txt files being tracked: Create a file with the extension ‘.gitignore’ and open it with any text editor, type .txt and save the file.

alt text