Skip to content

AnuththaraLak/introduction-to-github

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Welcome

introduction-to-github

Install Git on Your Local Machine

To install Git on your local computer, you need to visit this link.

It's easy to install Git on Mac/Linux than Windows 😒


1. Go to a Directory that you need to clone your Repository

Ex: D:\React


2. Right click & open `Git bash here` if you are a *Windows* user or Open `Terminal` if you are a *Mac/Linux* user in that directory location.

3. Type this command on it
git clone <Your-Repository-Url>

You can find Repository URL from the top of the repository

If you get any error while cloning the repo, please read this Stack Overflow Forum

SetUp Git

Download Git:

Logo

Git Configuration

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

So, let's get started!

Git Commands

This command is used to obtain a repository from an existing URL.

Git clone <repository url>

Open repository in local storage

Cd <repository name>

Checkout a branch into your working tree

Git checkout -b name
git checkout branchname

List down branches

git branch

This command lists all the files that have to be committed.

git status

This command adds a file to the staging area.

git add .

This command records or snapshots the file permanently in the version history.

git commit -m 'commit message'

This command sends the committed changes of master branch to your remote repository.

git push
  • if we create a branch locally
git push --set-upstream origin <branch name>

This command is used to list the version history for the current branch.

git log

About

Introduction to GitHub by the FOSS community in NSBM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published