Supported by
Organized by
Question, fell free to ask at sli.do:
#KITM10
https://sli.do
For learning purpose, use this sample project to contribute.
Okay then, i already open that link
Now, find that fork button
Everything goes okay
Use the command bellow to clone project
git clone https://github.com/wilson-ng/SimpleContribute.git
git clone [repository link]
example:
You can get repository link from click "Clone or download" labeled button
You must clone instead of Download as Zip
I will show you why you must clone it
Downloaded project
Cloned project
First we need to create new branch for our new feature
git checkout -b [branch-name]
example
git checkout -b add-my-name
After create a new branch, we can start working
Useful tips
use for switch branches or restore working tree files
use for create a new branch with specify branch name
use for create a new branch with branch name of remote tracking upstream branch name
For example, there are a task to do:
Add your name
update "CONTRIBUTORS.md", put your name and github link.
Create "Hello World!" script
create new file under scripts, see other scripts as a template.
Done??? Push your changes
To push your changes,
Look at what you changes with
git status
Look in detail what the hell you changes
git diff
Why new file of script doesn't show up???
git diff only tracking between commit or after indexing
Tell git to add your changes to be commit
git add .
Make sure what you changes, again...
git diff --staged
as you can see, that indexed file can be show the difference between commit
Commit your changes
git commit
example
git commit -m "add wilson"
Push your code, literally
# if you want to push new branch
git push -u origin [branch-name]
# if you want to push existing branch
git push origin [branch-name]
or
git push
DONE!!!
Open your project on github
You will be notice that your recently pushed branch
Click "Compare & pull request"
Make sure to leave comment, so the other can know what you do
Make sure to choose base fork branch and head fork branch you want to merge to
Because you want to contribute to public project, make sure you still polite when create comment
If everything is okay and it's say able to merge,
hit "Create pull request" button
If contribution guide exists, you must read and follow it before do any changes or create a pull request
Useful tips
Find some simple project and contribute to the project, nothing to lose if you contribute to open source
Next step of this leason, you need to sync your master branch to base fork master branch, try to learn about fetch upstream and merge to your branch
Thank you
Kindly fill the feedback for the better meetup.