Chuyển đến nội dung chính

How can I contribute my code to an open source project on Github?



Have you been used a library on Github yet? And asking yourself How do they create its and how can you contribute your code?

Today, It's so easy to contribute to an open source project on Github. In this tutorial, I'll show you how you can step by step. Here you go!

Choose a project to contribute to

So many projects on Github to choose from. But you should choose a project as a dependency your own projects. Why??? Because you can find bugs or inconveniences. So you probably want to improve it.

Fork and clone it

The first we need to fork the repo to our Github by clicking the "Fork" button in upper right hand on the repo landing page. Like the image below.

After forking is completed, we need to clone the fork to our local machine. You can copy the clone URL
by clicking on green "Clone" button like image below.

End then, we open terminal screen on our local machine and run command:

git clone https://github.com/doankhoi/react-use-intercom.git

OMG! You should have a clone the repo on your local machine.

Get newest code

We should setup a new upstream remote to sync code from original repo:
git remote add upstream https://github.com/devrnt/react-use-intercom.git

git pull upstream && git push 

Make a new branch

We should make a new branch with convention at here. Example we want to make a feature and master is current branch.

git checkout -b feature/adding-api-base-property

Code it up!

Now we have a new branch and ready to start coding new feature on it. Always remember code styles and write new test to cover any features you have added.

Commit and push the new branch to the your fork on Github 

To get a list files have changed you can run:

git status
Stage all files  with command git add . Commit the staged files and push them to new branch.

git add .
git commit -am "feat: add new property"
git push origin feature/adding-api-base-property

Submit a pull request (PR)

After pushing is completed. We can make a pull request to merge to original repo from forked repo.
Done! Happy Coding


Nhận xét

Bài đăng phổ biến từ blog này

Load balancing howto: LVS + ldirector + heartbeat 2

Problem A high capacity load balancing solution is needed to address current and future needs to provide highly available and scalable services. Solution Linux Virtual Server (LVS) provides the means of building scalable and high performing virtual cluster server. Heartbeat 2 can be used to feather increase the availability of the virtual services. Limitations Iptables redirection to avoid ARP problems with direct routing load balancing is not covered. Heartbeat 2 SSH STONITH is used without quorumd or pingd. Very limited "tiereaker" capability. Concepts LVS hides real servers behind a virtual IP and load balances the incoming request across all cluster nodes based on a scheduling algorithm. It implements transport-layer load balancing inside the Linux kernel, also called Layer-4 switching. There are 3 types of LVS load balancing: Network Address Translation (NAT) Incoming requests arrive at the virtual IP and are forwarded to the real servers by changing the...

Thủa sơ khai của React - Pure React

Pure React Chúng ta hãy cùng bắt đầu học Reactjs với cách viết Pure React. Nói không với các bước compile, không với Webpack, Parcel, JSX mà chỉ có Javascript thuần tuý thôi. Vì mình biết nếu bây giờ nhảy thẳng vào các khái niệm đó, các bạn sẽ choáng ngợp bởi có quá nhiều khái niệm, và cũng không hiểu rằng tại sao họ lại dùng những thư viện đó và dùng nó khi nào nữa :) Nào hãy cùng tạo một project tên là adopt-me  mình lấy tên như này bởi mình muốn sử dụng API của trang Petfinder.com  cho các bài hướng dẫn sau về xử lý kết quả trả về từ API. Và cũng vì lý do nhân văn là các bạn nên nhận nuôi một con thú cưng nhé hihi. Mình khuyến khích các bạn lập trình sử dụng hệ điều hành Linux hoặc MacOs nó rất tiện cho bạn sử dụng dòng lệnh và thao tác nhanh chóng như dân lập trình Pro. Chúng ta bắt đầu tạo một thư mục adopt-me , dưới thư mục chúng ta tạo một thư mục src lưu code và tạo một file index.html trong thư mục đó. Cách đơn giản là bạn mở terminal lên và gõ câu lệnh. mkdir -p ...

Thái Lan - Điểm đến đầu tiên trong chuyến du lịch.

Nhắc tới Thái Lan nhiều người chưa từng có cơ hội tới đây ban đầu sẽ mường tượng trong đầu là một đất nước nằm trong khu vực Đông Nam Á cách Việt Nam không xa. Khi chưa tới đây mình chỉ biết đến Thái Lan qua những trận cầu nảy lửa giữa Việt Nam - Thái Lan hihi. Bởi vì mình cũng là một fan của bóng đá. :) Nhưng chắc do bà xã kéo đi chơi nên mình cũng thử một lần đi cho biết thế nào. Thế là mình bắt đầu lên kế hoạch cho chuyến đi chơi đầu tiên của mình ra nước ngoài. Mình dự định sẽ đi BangkokThái Lan trong vòng 6 ngày và có 4 người khác cùng đồng hành. Việc đầu tiên là mình tìm kiếm vé máy bay cho chuyến đi. Ban đầu mình có suy nghĩ có thể sẽ đặt theo tour du lịch thì mình sẽ không cần phải lo tới việc đặt vé máy bay, đặt phòng khách sạn. Tại thời điểm đó mình cũng có tìm kiếm các tour du lịch Thái Lan trọn gói. Vì là lần đầu nên mình tìm hiểu khá kỹ. Các tour du lịch bắt đầu từ Hà Nội - Thái Lan đi 5 ngày 4 đêm có giá vé dao động khoảng 9 đến 10 triệu đồng cho một người. Tu...