Getting Started on Github : Essential for Developers
What is Github ?
Github is an online platform where you can store your code for collaboration.
What is repository
A repository is simply a folder in which files of one particular project are stored.
Concept of branching on Github
Branching is a way to work on different versions of a project.
Suppose you are working on a project. Raman, your friend want to modify a part of that project. So, instead of making changes on the master project, he gets a copy of original project in which he can commit changes. If the changes he made, are approved, the admin can merge his branch into the master and hence the project is modified.
There are 2 Methods to start working with git-
- Push code from local directory to git repository.
- Pull code from existing repository in local directory.
How to start a git repository?
Navigate to the project directory in terminal or CMD and run the command below-
This will make the directory a git enabled directory. Make sure you have installed Git on your system.
Every time you make some changes in your code, you have to tell git that you have commited some changes in the code that need to be pushed to the git repo.
git add .
To add changes or new files to the commits.
git commit –
Reference links :