GitHub is a cloud-based service website in which the developers can store, manage, track and control changes to their code. There are two connected principles.
What is version control?
Version control is also called as source control, which is used for tracking and managing changes to software code. Version control systems are software tool in which developers are able to manage changes to source code.
There are two main processes in version control
Branching is a process in which part of the code gets duplicated which is called repository for the purpose of development.
After the process of developing the Code if the developer finds that the part of the code is working properly, he/she can merge the code to the main source code.
What is Git?
Git is a free and open-source version control system which is designed for the purpose to handle everything from small to very large projects with speed and efficiency.
Creating a new repository:
1.In the upper-right corner of the page, click the + drop-down menu, and select new repository.
2.Type a short, memorable name for your repository, like the one which is shown below.
3.Choose a repository visibility:
NOTE: Repository which is created here is an empty repository. If you want you can also initialize it with a README file.
4.Click create repository:
You have successfully created your first repository.
Once the repository is created successfully it will guide you to a new page, which will show you the URL.
Just copy the URL and paste it like this (git clone <URL>) in your Windows PowerShell, make sure that git is installed in your device.
Git clone command is mainly used for downloading source code from a remote repository to local repository.
The coding editor used here is visual studio code, to include the project file just give the command (code.), which will guide you to the visual studio code editor. Create your project in the code editor, after creating your file make sure that the file has been included
Git add command tells Git that you want to include updates to a particular file, when we create, modify or delete a file these changes will happen in our local. To use this command just include file name along with the Git add command (git add<file name>). In conjunction with these commands, you will also need Git status which will provide all the necessary information about the current branch.
However, Git add command will not really affect the repository until you run Git command.
If the developing process reaches a certain point in development, the changes have to be saved.
Git commit is like setting an endpoint in the development process which can be used for later purpose. A short message can be written along with the command (git command -m “short message”) to mention the changes that we have made while developing the code.
After committing the changes, the next process is to push local repository content to remote repository. The Git push command is used to upload local repository content to a remote repository.
After the process of transferring the project file from your local repository to a remote repository by git push command just refresh the GitHub page and you will find your project file.