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

Using Vim Editor

The Vim is a tool editor text. It is used as the most popular and powerful tool. In the context of Vim, it can operate in two modes: command mode and insert mode. The editor always starts in command mode. In the command mode, we can move through the text, search, replace, mark blocks and switch the editor to insert mode. The first, we will install Vim. On ubuntu sudo apt-get install vim On CentOS sudo yum install vim We use command vi file_name to open file in the Vim editor. We will start with some basic commands. Basic commands h to move the cursor to the left l to move it to the right k to move it to the up j to move it to the down G to move it to the begin of last line gg to move it to the begin of first line :n to move it to line n of the file Basic operations n dd will delete n lines starting from the current cursor position. u will undo. ctr + r will redo. n dw will delete n words starting from the current cursor position to right...

Làm thế nào để có thể nhúng source code vào bài viết trên Blogger?

Nói nhảm Là một developer mình luôn luôn muốn chia sẻ những gì mình học được tới mọi người. Và một trong những cách đó là ngồi viết nhảm nhí trên blog :). Hôm nay chợt nảy ra ý định muốn tạo các bài hướng dẫn các sử dụng ReatJs từ cơ bản tới không còn cơ bản nữa. Nhưng chợt nhận ra mình không có khả năng viết lách lắm :) Nói hơi nhảm xíu nhé mọi người. Nhưng nếu ai ủng hộ mình viết một series hướng dẫn lập trình web sử dụng ReactJs thì comment bên dưới nhé. Còn bây giờ quay lại chủ đề chính của mình trong bài viết này là làm sao có thể nhúng đoạn code đẹp trai này vào bất cứ blog nào hỗ trợ soạn HTML. Javascript 1 console.log( "Bạn rất đẹp trai" ); Python 1 print ( "Bạn còn đẹp trai hơn" ) và có rất nhiều ngôn ngữ khác nữa. Wow nghề viết lách lại không đơn giản :) Nói thật Mình có hỏi bạn bè đồng nghiệp và rồi hỏi anh Google thân thuộc thì hiện tại tìm được hai giải pháp có thể giúp anh em code tung trời và trình bày đẹp trai trên bài viết của mình. Cách t...

Introduction Heartbeat

In this tutorial, I show for you some concepts about heartbeat.  Heartbeat is a project from Linux-HA (Linux high available). The goal is t provide a High availability clustering solution for Linux. Heartbeat is the daemon which provides the cluster infrastructure. In order to be useful, heartbeat needs to be combined with a Cluster Resource Manager (CRM), which is the one in charge of starting and stopping the services (Web, DNS, Database, File servers and/or IP Addresss) to make them Highly Available. Through the years, Heartbeat has evolved and has different types of configurations: Heartbeat V1: This type of configuration uses the Version Cluster Resource Manager. This is also known as legacy Heartbeat. It allows us to configure two cluster node in active / passive or active / active configurations. Heartbeat V2: This type of configuration is related  to the use of the version 2 Cluster Resource Manager. It allows us to configure two or more nodes in active / pass...