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...

npm, ESLint & Prettier

Tiếp nối bài viết trước mình đã giới thiệu các bạn cách dùng ReactJs chỉ thuần Javascript. Tuy nhiên trong các dự án thực tế người ta không sử dụng cách làm việc đó để tạo nên một sản phẩm chất lượng dễ dàng maintain. Một trong những cái quan trọng hơn cả là làm việc nhóm được với nhiều người. Bạn thử tưởng rằng, trong một project mà mỗi ông thích code một phong cách thì sau một thời gian nó sẽ thành một một mớ hỗn độn :) npm npm là viết tắt của cụm từ Node Package Manager. Nó là một Package Manager cho Nodejs. Ngoài npm thì bạn cũng có thể sử dụng một công cụ khác là yarn . Bạn tưởng tượng rằng có rất nhiều người viết các thư viện open source và đẩy lên Node Registry, bạn có thể dùng npm để kéo các thư viện đó về project của mình. Không chỉ dừng lại ở đó npm cũng có thể sử dụng như một command line tools cũng rất ổn. Để bắt đầu sử dụng npm bạn di chuyển tới thư mục gốc của project adopt-me và chạy lệnh npm init . Nếu bạn chưa cài đặt Node, bạn có thể tải bản mới nhất về cài. Khi...

How to pass "This app hasn't been verified by Google yet" in App Script

Why use App Script? App Script let's you do more with Google, all on a Javascript platform in the cloud. You can use Google Spreadsheet, Google Calendar, Gmail, Google Form ... Problems When you completed your application and need testing how it works. You click on run button After then you get. Oh my god :( Don't worry about it. You can see button Advanced . Please click on it Click Go to Testing (unsafe) --> Allow Done. Happy coding :)