Step-by-Step Guide for beginners for getting started with Open-Source
💻
Here The Contribution BeginsIf you are a beginner then this repository is for you. By this tutorial you are going to learn how to make your First Pull Request for sure.
👋
Join our discord community CodeSmashers
⭐
STAR THIS REPOSITORY THIS WILL PAY OFF MY WORK
1. The first thing you need is Git installed on your system, if it is not installed then download it as per your OS and install it.
Git Setup :-
- Download Git as per your OS.
- Git installation Video as per your OS.
- Install Git
- Open the Git Bash ( Right Click )
- Run the Commands
- You should be able to see your entered name and email under user.name & user.email
$ git config --global user.name "Your Name"
$ git config --global user.email [email protected]
$ git config --list
2. You should have an account on GitHub if you you dont't have an account then simply make it.
3. You will need a text editor accoring to your comfort , I prefer Vs code
- Download Vs Code as per your OS.
- Vs Code installation Video as per your OS.
- Install it.
4. Now you just have to setup the project from GitHub to your local system.
Setting Project on your Local System :-
- Fork this Repository or Project
- This will create a copy of this repository in your account.
- Copy the link of the Repository
- Open Git bash where you want to clone the project and clone it
- Clone it
- Run Command and Hit Enter
git clone
In this case it is
git clone https://github.com/arpit456jain/Getting-Started-with-open-source.git
- After you hit enter you will notice that some downloading will start. It's actually cloning of repo form your GitHub repository to your local system.
- After this you will notice a folder is created with the name of repository
- Then just close the Git bash and open this folder and open VS code here
5. Now Make necessary changes and commit them , lets say you have to add your name in readme , you already set up the project in local system . Now before starting your work always rembember to pull latest change from the main Repo.
- Fetch And Merge
- Pull these changes in your local system
- make a new branch and then make the changes , then commit them. make sure to commit to the new branch
Never commit in master branch - After commiting your changes on your local host you have to push that changes to GitHub , make sure you push the new branch
git pull origin master
git checkout -b new_branch_name
git add -A
git commit -a -m "message"
git push origin new_branch_name
6. Make the Pull Request
- when you push the changes you will notice a new branch will be created on GitHub and there will be a green button for creating pull request. Click on it.
- After this a new page will be open like this
- Now add a title and description of your PR and click on create pull request.
- Congrats
🎉 your Pull Request is created
Some Common Error And Their Solutions
1. Updates were rejected or failed to push some refs.
This is most common error you will find and its pretty easy to solve .
Solution: You just have to pull latest changes to your local system first and then you can push them
git pull origin master
Note : if your repo is a forked one and its some commit behind then first fetch n merge then pull changes
Common Git Commands you should know!!!
1. Git checkout
git checkout
2. Git init
git init
3. Git diff
git diff
git diff --staged
gif diff
4. Git add
git add
git add .
5. Git branch
git branch
git branch
git branch -d
6. Git log
git log
git log -p -1
7. Git clear
git clear
What if I have Merge Conflicts?
A GitHub conflict is when people make changes to the same area or line in a file. This must be fixed before it is merged in order to prevent collision in the main branch.
-
Github Docs - About Merge Conflicts
To read more about this, go to -
Github Docs - Resolve Merge Conflict
To find out about how to fix a Git Conflict, go to
Now just make a Pull Request and add your name in Read me file.
CodeSmashers Community
-
A -
B -
C -
D -
E -
F -
G -
H -
I -
J -
K -
L -
M -
N -
O -
P -
Q -
R -
S -
T -
U -
V -
W -
X -
Y -
Z
Project Admin❤️
Arpit Jain |
Ankita Puri |
✨
Contributors
Thanks go to these Wonderful People 👨🏻💻:
Contributions of any kind are welcome!