Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GitHub offers the distributed version control and source code management functionality of Git, plus its own features. Some alternatives of GitHub are gitlab, BitBucket, etc.
- Introduction to Git and GitHub This is a highly recommended course for anyone new to Git. It also covers a few advanced topics.
This is an oversimplified way of contributing.
For more advanced usage, we can use branches and commands like adding upstream url and doing git fetch
. Please read about these concepts online. Some great explanations can be found here and here. They're a must read for everyone.
- Fork the repo which you want to work on (eg. https://github.com/ivlabs/resources is original repo where you want to contribute)
- Clone the forked repository from your own profile (NOT the original repository)
git clone https://github.com/your_userid/resources
- Do the changes and commit.
git add file1 file2
git commit -m "Adding my contribution"
- Push changes to GitHub. This updates your forked repo.
git push origin master
- Create a pull request.
- If the owner finds your changes correct, he will merge it with his original repo.
- Congratulations! You just contributed to the original repo.
Resources: Link
- Delete the old fork (if the master is ahead of your fork).
- Create a new fork and do all changes there.
- Create a Pull Request and repeat above steps.
- Thats it!