GitHub has been popularly referred to as the social network for all programmers. In fact, it is the biggest community for developers from every part of the universe. However, unlike other social networks, you need to know something very well before planning to learn how to use GitHub. That thing is Git; it can be described as a distributed version control system. You already know that in a building construction, the foundation of the structure must be strong for the building to be stable. In this case, Git is the foundation while GitHub is the building. GitHub is built over the Git. This is why it is practically and absolutely necessary for you to learn about Git before moving on to GitHub.
What Are Git And Github?
Git is an open source and a free distributed version control system whichhas beendesigned to take a grip on everything from small projects to large projects with efficiency and speed. Git helps you to manage any change that is made to a code repository. It is known to be a very useful software that can help in streamlining development for programming projects. Git comes with no file structure requirements or language requirements, making it open for developers to make a decision on how they want their workflow to be structured.
GitHub can be defined as a Git repository hosting service that is web-based. It offers a source code management and distributed revision control functionality of Git while at the same time adding its own features. To explain it in simple terms, GitHub is a site that provides hosting for Git and also provides collaboration and project management features.
How to Setup Git and Github?
The first two important things you need to do are to install Git and create a GitHub account for free. You can follow the instructions at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git to install Git if you don’t have it already installed. The moment you are done with that, go ahead to create free GitHub account at https://github.com/join. Basically, GitHub accounts are free for the public repositories. However, for private repositories, some amount is charged.
Getting started with the Git
- Open the Git Shell application on your computer
- Then, enter these lines (ensure you make the necessary changes):
git config –global user.name “Karan”
git config –global user.email karan@singh.edu
- You only need to do this once
- If you wish to make use of another email address or name for a particular project, you can make the change for just the project.
The Repository
- The top-level working directory comprises everything about your project
- The working directory also contains many subdirectories – binaries, data files, documentation, source code etc.
- One of these subdirectories which are named .git, is your repository
- The dot designates a “hidden” directory
You are not working with the contents that are in the directory; instead, the git commands are doing the work.
- At any stage, the snapshot of a selected number things or everything can be taken within the project directory. You can then put this in your repository.
- This “snapshot” you have taken is called a commit object
- This commit object comprises a set of files, references to the “parents” of the commit object itself, and a unique “SHA1” name
- Note that the Commit objects do not need huge amounts of memory
You perform a lot a work in the working directory, however, the repository will not be updated until you commit something.
loading...
loading...