In the world of software development, you need a supportive community and collaborative individuals to help you work on your project, discuss technical ideas, and get guidance and directions to improve your perfGitHubormance in writing code. GitHub, which we will talk about today, is one of the ideal solutions that provide you with that.
GitHub can be thought of as a social networking platform geared toward bringing together programmers and developers in particular, enabling them to exchange code, share technical ideas, and collaboratively create great websites and apps.
Therefore, it is necessary for any developer to learn how to deal with this platform that millions of programmers and developers around the world use to write code and control versions. In this article, we will explain to you in detail what GitHub is, what its benefits are, and how to start using it.
What is GitHub?
GitHub is an online platform that brings together developers from all over the world and provides a service to host their software projects and enables them to cooperate and communicate with each other and work on developing software jointly and provides them with an easy-to-use interface that enables them to manage their projects without the need to use command-line programs.
GitHub includes many useful features that allow development teams to work with each other on the same project and easily create new versions of software without the need to stop existing versions.
You can create a free account to work on the GitHub platform, add your projects to it, publish it to the public, or make it your own, knowing that GitHub makes money by selling private projects hosted with it, and it also provides paid plans for business owners and organizations with many members to facilitate the management and development process projects collaboratively.
What are the benefits of GitHub?
GitHub offers you many benefits and here are the top 7 benefits:
- Using GitHub facilitates the process of developing software projects and flexibly controlling tGitHub/heir different versions.
- You can use GitHub as a platform to back up your project.
- GitHub allows you to work on the code for your site or app with anyone and collaborate with other programmers from anywhere in the world.
- It is an ideal platform to create a profile to showcase your best programming work.
- GitHub is a great learning resource to expand your programming knowledge as many people on the platform are looking to gain a following by writing useful technical articles or even creating podcasts or creating educational videos on the GitHub educational YouTube channel.
- It keeps you informed of the best programming practices, as software technologies are constantly evolving, and the way to write instructions may change with each new version, and through GitHub you will be able to see everything new and the method of solving problems in the best and latest ways.
- Many employers today depend mainly on GitHub, so if you are seeking to get a prestigious job, it is necessary to learn to deal with GitHub
What is the difference between Git and Github
Github works in cooperation with the Git tool, and they are usually confused. To distinguish between them easily, we can say that GitHuGitHubb is a platform that provides hosting service for Git repositories, or in other words, Github is a code hosting site that provides all Git functions and also extends its basic functions.
It should be noted that there are many other alternative services that provide the advantage of hosting Git repositories other than GitHub, such as GitLab, BitBucket, and SourceForge, but GitHub is the most popular among these platforms.
So what is Git? Git is a version control system created by the famous software engineer Linus Torvalds who laid out the Linux kernel and who originally created Git to track code changes during the development of the Linux operating system.
Through Git, you can track the changes that occur in the code, such as adding, modifying, or deleting code, and upload them after completion to a repository on the GitHub hosting platform.
Thus, the primary role of Git is to help programmers cooperate and coordinate work with each other when writing complex code and development projects, and enable them to track changes and help them work remotely in complex programs.
Thus, it is Git that provides you with the development of software (and non-software) projects easily and safely, monitoring the progress of the project, switching between versions, and dividing teams easily to develop different works within the project, and GitHub is the platform that hosts this project for you within the (Repository) repository.
The word Repository or repository in Github can be considered synonymous with the word software project . The repository includes everything related to the project, including files, images, spreadsheets, videos, etc.
You can work using the Git command line to communicate with GitHub by installing Git on your computer and controlling the repository with a set of special commands within Git itself, or you can simply rely entirely on the GitHub platform to do all the work only through it, and the GitHub app is also available For the desktop , which provides greater ease in completing tasks and communicating with the GitHub platform.
What is meant by local warehouse and remote warehouse?
During your work on the Local Repository and Remote Repository platforms, you will encounter other terms, and in this paragraph we explain to you the most important of these terms and what is the difference between them.
The repository or project that you create on GitHub is called the remote repository (a repository on the cloud) and all members of the software team can access this folder, and pull a copy of it ( Pull ) to start working on it.
The local repository is the project on your local machine and inside it there is a .git folder responsible for keeping track of the changes you will make to the project and it is also called the workspace.
In the event that you are working on the local repository, there will be synchronization between the local and remote repositories. If you make a modification to the code of the local repository, the modification will be done, but temporarily and not permanently, on a staging area .
After you have completed all the modifications and are satisfied with the result, you must install these modifications in the local repository. This process is called ( Commit ), then you must upload it from the local repository to the remote repository on Github, where that data is pushed by the ( Push ) process so that the rest of the team members can view the changes. that you made and brought to them.
This mechanism can keep your local repository in sync with your remote repository when changes are made to either.
Steps to use Github
To use GitHub, you must follow these steps:
Create an account on the official GitHub platform by clicking on the Sign Up button and entering all the required data
Register on GitHub
Then click Continue For Free to create a free account and start using GitHub right away.
With a free GitHub account, you will be able to create an unlimited number of software repositories (Repo), whether public or private, but the only restriction in the free version is that it enables collaboration between up to three people for private repositories.
After creating your account on the site, you will see the welcome page shown in the following image. Next, you are now ready to create your first warehouse or project on the platform (or you can bring a pre-existing warehouse to continue working on it).
To create a new repository, click on the green Create repository button at the top left of the page, where you will see a new repository creation page that asks you to type the name of your repository, add a short description for it, select the type of repository (Public or Private), and select the Add a README checkbox file which refers to adding a text file to write a more detailed description of your project.
You can also add a .gitignore file to the repository, with which you can tell Git which files and directories you want to ignore and not track in your repository, and select a template from the Template drop-down list to help you create the file and specify which files are recommended to be ignored on known platforms. Finally, you can choose a license that shows other users what they can do with your code.
Create a repository in GitHub
After you have finished specifying all the repository data, you can click on the Create repository button at the bottom of the page to create the required repository in your personal account. It includes three automatically created files, which are:
.gitignore
LICENSE
README.md
You are now ready to start your first project on the GitHub platform, add your files to your repository, edit them, and control them as you wish.
What are Github Branches?
Branches on GitHub
By default, your repository contains one branch, the main branch. You
can create more than one branch of the repository in case of multi-use projects that need many versions when they are created. Branches are ideal for new features or bug fixes.
The branches feature in GitHub allows you to edit several unique versions of the repository at once, work on a number of different branches by different people at the same time, and make modifications to them before saving and merging them into the main project folder.
This facilitates the process of coordination between the programming teams in one project who work in conjunction with each other in real time, where a new branch is created by each programmer and changes are made to it, and thus the team members continue their work in modifying the code each in its own branch without overwriting each other's work.
This process, which is known as branching or branching, is mainly intended to make a copy of the main program, make some improvements to it and eventually reflect it on the project, and the branch goes through many stages before merging it into the main program.
These branches are like the local copy of the repository When a new branch is started it becomes a copy of the master branch until you edit it to make new changes Changes made to it in the home folder will not be reflected in projects on other users' machines unless they check out these changes to merge them .
To start a new branch on GitHub, go to your repository page and click on the main tab . A drop-down box will appear as shown in the following image.
Create a branch of the project
In the text box that appears, type a name for the branch (eg EDIT README), then click Create EDIT README branch to create the desired branch and apply changes to it.
To make changes to the EDIT README branch you just created, go to the branch page view and open the file you want to change in the project and then click on the edit icon (pen icon) on the top left and make the adjustments you need
Edit a file in the branch
Below, write a message explaining your changes before you save them. Each saved change is called commit and has its own message associated with it to further explain why you made the change to the project. You can undo any change you've made by clicking the Cancel changes button at the top right.
and tweet the branch changes
It is best not to be lazy to write letters describing every change you make, no matter how small, because this helps you to remember them over time and helps other programmers who contribute to the project to understand the progress of the changes that are taking place in the project
After you are done and satisfied with your changes, click Commit changes at the bottom to implement or install these changes.
Confirm the branch change process
To pull changes from a branch and merge any branch with the branches someone else is working on, you need to create a pull request in which you notify the parties involved in the project that you want to make changes to the project.
To open a pull request go to the warehouse page and click on the Pull Request tab and click on the new pull request button
Request to withdraw changes from one branch to another
You will see the Comparing changes page , which shows the changes differences between all branches of the project, select the name of the branch you created from the drop-down list and compare it with the main branch to view the content differences between the two branches, which shows the content that has been added in green and the content that has been deleted in red as follows:
Comparison of two branches of the project
After you are sure that the changes are appropriate for the project, click the Create pull request button to create a pull request .
The next Open a pull request page appears, which asks you to give the request an appropriate title and description to briefly describe the changes to the branch.
Request to merge the branch with the project
Type the appropriate data and press the Create pull request button to check that there is no conflict between this branch and the master branch, and a button titled Merge pull request is displayed to merge your pull request with the main project, or you can close and undo the request by clicking Close pull request .
Approval of the request to merge the branch with the project
Now click on the Merge pull request button, a new button titled Merge confirm will appear. Click on it to confirm the process of merginGitHubg your branch into the main branch of the project. Then your branch will be deleted after all the required changes have been incorporated.
Confirm the merge of the branch from the project
Conclusion
With this, we have come to the end of our article, which gave you a general and comprehensive idea about the GitHub platform and its importance to developers in general and WordPress developers in particular, and explained how to use it to create and modify software projects.
You still have a lot to learn and explore on this wonderful platform, so start by creating your account on the platform from now and explore it and learn to deal with it and benefit from its many advantages..
GitHub is not just a platform for software version control, but rather an active and collaborative software community that enables you to showcase And share your own projects and access to millions of codes for websites and applications written with various software technologies.
Comments
Post a Comment