Skip to content

nahidhashik/git-cheatsheet-for-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 

Repository files navigation

9

WHY Git?

Git is a version control system. Its original purpose was to help groups of developers work collaboratively on big software projects. Git manages the evolution of a set of files – called a repository – in a sane, highly structured way.

WHY Github?

Understanding GitHub isn't complicated, I think! But at first, we have to understand Git. Well, Git is an open-source version control system that was started by Linus Torvalds—the same person who created Linux.

Version control system means for example when developers create something such as an app, they frequently change the code and releasing new versions up to and after the first official (non-beta) release, this system always keeps these revisions straight, storing the modifications in a central repository.

By this developers can easily collaborate, can download the beta version also can make changes to the code, and tries to upload the newest versions, same as unofficial developers can still download the files and use them.

GitHub Definition

Coders can share ideas and methods and make awesome software and GitHub brings them together as a team and coding experts onto one collaborative platform. Sounds difficult to hear? Let me explain it in further detail.

GitHub is a code hosting platform for Coders and Non-coders to work together on projects. Anybody can take advantage of Git by GitHub. Without GitHub, using Git generally requires a bit more technical savvy and use of the command line.

Benefits of GitHub?

Why! GitHub? There are several reasons for that.

It enables slick and easy collaboration with version control. This allows you to work on code with anyone from anywhere. If you plan on getting a job, you’ll look really good if you already know your way around GitHub It allows multiple developers to work on a single project at the same time. It reduces the risk of duplicative or conflicting work and can help decrease production time. With GitHub, developers can build code, track changes, and innovate solutions to problems that might arise during the site development process simultaneously. Non-developers can also use it to create, edit, and update website content, which Carpenter demonstrates in her tutorial.

INSTALLATION

This site was built using For windows download Git bash from here

Watch This Tutorial

Create Github Account

Watch This Tutorial

Create Repository in Your Github

Watch This Tutorial

Using Github from Windows git

Watch This Tutorial

How to Host a Website on GitHub Pages for Free

Watch This Tutorial

Git bash Commands for Github

Basic

git --version

You can check your current version of Git by running the git --version command in a terminal (Linux, macOS) or command prompt (Windows)

user@localhost:~$ git --version

version

git clone

If you want to get a copy of an existing Git repository — for example, a project you'd like to contribute to — the command you need is git clone

user@localhost:~$ git clone

clone

ls

The ls command lists the current directory contents and by default will not show hidden files

user@localhost:~$ ls

ls

cd DirectoryName

user@localhost:~$ cd new_dir

mkdir

cd ..

user@localhost:~$ cd ..

cdplus

git add .

user@localhost:~$ git add .

add

git commit -m ""

user@localhost:~$ git commit -m "your message"

commit

git push origin BranchName

user@localhost:~$ git push origin main

pushorigin

Status Check

git status

user@localhost:~$ git status

status

git log

user@localhost:~$ git log

log

Create file

touch FileName

user@localhost:~$ touch NewFile

touch

Delete file

rm FileName

user@localhost:~$ rm NewFile

rm

Create Directory

mkdir DirectoryName

user@localhost:~$ mkdir new_dir

mkdir

Delete directory

rmdir DirectoryName

user@localhost:~$ rm new_dir

rmdir

Branch Create

git branch

user@localhost:~$ git branch

branch

git branch NewBranchName

user@localhost:~$ git branch seond_branch

newbranch

git checkout BranchName

user@localhost:~$ git checkout second_branch

checkout

Pull Request

git pull origin BranchName

user@localhost:~$ git pull origin second_branch

pull

Merge Request

git merge BranchName

user@localhost:~$ git merge second_branch

merge

Note

Every changes you neeed to three commands

git add .

user@localhost:~$ git add .

add

git commmit -m " "

user@localhost:~$ git commit -m "your message"

commit

git push origin BranchName

user@localhost:~$ git push origin main

pushorigin

License

MIT-LICENSE.md

Conclusion

Fork, pull request, and merge – are three features that make GitHub so powerful. If you wanted to contribute to an open-source project you had to manually download the project’s source code, make your changes locally, create a list of changes called a “patch” and then e-mail the patch to the project’s maintainer. The maintainer would then have to evaluate this patch, possibly sent by a total stranger, and decide whether to merge the changes.