A Tale
Jack - Made a project on web development and posted it on Github you want to add some features to it.
You - Make the changes you want and send him a pull request he reviews it and adds it to the project.
Pull request - When you have made some changes to someone's project you send that person a pull request he/she reviews and adds it to their project.
It will take us 7 simple steps to make our first pull request.
Let's Begin !!!!
Prerequisites:
Github account: SignUp/Login
Install Git: Dowload from here
Note: If this is your first time using git then download and install .NET Framework 4.8 as well and restart your computer. NET Framework 4.8
- Install VS Code(Optional): Dowload from here
I have made a repository on Github to which we are going to contribute.
Step 1 - Fork
- Firstly we fork the repository.
Step 2 - Clone
- Once you have forked the repository the project will be shown on your account.
- Copy the link for cloning it from your account.
- Open Git Bash
Firstly
- enter your credentials in git.
git config --global user.name "your username"
git config --global user.email "youremail@example.com"
- If you are not on desktop type
cd Desktop
(this means we are now on desktop)
- clone it.
- Now the project is cloned on your computer locally.
Step 3 - Branch
We have to go to the folder we just cloned and to do that we use the command cd and the yellow color shown here specifies the path.
Initially, we are on the main branch but it's always better to create a branch to work on.
- I am creating a branch called new-branch just for explaining but it's better to name it something which is meaningful.
Step 4 - Changes
Let's make some changes
- Go to the created folder on your desktop there is a file called index.html right click and open it with VS Code or notepad.
- Add any fact that you like with your name and save the file.
The Output :
- You can check the changes you have made.
Step 5 - Commit
- We add the changes to new-branch.
- now we commit it with a message which specifies what we just did
Step 6 - Push
- We first check the remote name in our case its origin and then push the changes to Github.
Then a dialog box appears click on sign in with Github and give access.
Step 7 - Pull Request
- If you go on your Github profile you will see something like this click on it.
- You leave a comment explaining what you did then click on create pull request.
Done, with that you just made your first pull request.
As soon as your pull request is merged you will get an email.
I will merge your fact and display it on this website
If you learned something new today why not connect with me?