DEV Community

okoriek
okoriek

Posted on

Git and GitHub

Introduction to Git and GitHub

Working on a project alone can be sometimes tiring and slow, hence the need for more than one individual for a more fast and productive project. Git and GitHub as a platform encourages group project, source control and lot more, it gives the individual the leverage of contributing to a Project at a convenient time and space

Get started with git and github

Download Git for Windows

  1. Browse to the official Git website: https://git-scm.com/downloads

  2. Click the download link for Windows and allow the download to complete.

Basic Command in Git and GitHub

Version:
displays the version of github that is on you system

git --version
Enter fullscreen mode Exit fullscreen mode

Create an account:
This command is for creating an identity on github which will be required when trying to pull or push to a github repository

git config --global user.name "Jane William"
$ git config --global user.email "williamjane@email"
Enter fullscreen mode Exit fullscreen mode

Settings your default branch:

By default Git will create a branch called master when you create a new repository with git init. From Git version 2.28 onwards, you can set a different name for the initial branch.

To set main as the default branch name do:

git config --global init.defaultBranch main
Enter fullscreen mode Exit fullscreen mode

Getting Help
Getting help in git is quite easy, there is a compile list of command to get you started on git and github, the help command are straight forward and can be done in three ways

git help <verb>
git <verb> --help
man git-<verb>
Enter fullscreen mode Exit fullscreen mode

Cloning an existing project:

The git clone command get the full copy of a particular git repository into your local machine, it is meant to easy development and can be done using

git clone

https://github.com/ecommerce/website
Enter fullscreen mode Exit fullscreen mode

Conclusion
Git and github has alot of command which cannot be covered on this article, here we make sure you can get started with using git and github , on the next article we will be take on more command on git and there usage

Top comments (0)