mirror of
https://github.com/LucasVbr/first-contributions.git
synced 2026-05-13 17:21:50 +00:00
122 lines
11 KiB
Markdown
122 lines
11 KiB
Markdown
[](https://github.com/ellerbrock/open-source-badges/)
|
|
[<img align="right" width="150" src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/join-slack-team.png">](https://join.slack.com/t/firstcontributors/shared_invite/zt-1hg51qkgm-Xc7HxhsiPYNN3ofX2_I8FA)
|
|
[](https://opensource.org/licenses/MIT)
|
|
[](https://www.codetriage.com/roshanjossey/first-contributions)
|
|
|
|
# Contributions แรก
|
|
|
|
| <img alt="GitHub Desktop" src="https://desktop.github.com/images/desktop-icon.svg" width="200"> | GitHub Desktop Edition |
|
|
| ----------------------------------------------------------------------------------------------- | ---------------------- |
|
|
|
|
มันเป็นเรื่องยาก, มันยากเสมอในครั้งแรกที่คุณทำอะไร โดยเฉพาะเมื่อคุณทำงานร่วมกัน, การทำผิดไม่ใช่เรื่องที่สบายใจ แต่ โอเพนซอร์ส (open source) นั้นเป็นเรื่องของการทำงานร่วมกัน และเราจึงอยากให้ผู้ที่เข้ามาใหม่ได้เรียนรู้วิธีการ "คอนทริบิ้วต์" ผลงานร่วมกับผู้อื่นใน GitHub
|
|
|
|
การอ่านบทความและการดูวิดีโอสอนอาจจะช่วยให้คุณเข้าใจได้ดีขึ้น แต่มันยังไม่เท่ากับการทำจริง ๆ โดยไม่ทำผิดอะไร โครงการนี้จึงมีวัตถุประสงค์เพื่อให้ผู้ที่เข้ามาใหม่ได้เรียนรู้วิธีการ "คอนทริบิ้วต์" ผลงานร่วมกับผู้อื่นใน GitHub โดยที่ไม่พลาดอะไร
|
|
ยิ่งคุณผ่อนคลายมากเท่าไหร่ คุณก็ยิ่งเรียนรู้ได้ดีมากขึ้นเท่านั้น !
|
|
ถ้าคุณอยากร่วมส่งคอนทริบิ้วชั่นครั้งแรก ให้ทำตามขั้นตอนด้านล่างนี้ แล้วคุณจะเห็นว่ามันน่าสนุกมาก
|
|
|
|
ถ้าคุณยังไม่มี GitHub Desktop ในเครื่อง, [ดาวน์โหลดเลย](https://desktop.github.com/)
|
|
|
|
ถ้าคุณใช้ GitHub desktop เวอร์ชั่นเก่ากว่า 1.0, [อ่านที่นี่](github-desktop-old-version-tutorial.md)
|
|
|
|
<img align="right" width="300" src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/fork.png" alt="fork this repository" />
|
|
|
|
## กด "Fork" โปรเจ็คนี้
|
|
|
|
คุณสามารถแยกโปรเจ็คหลักออกไปทำที่แอคเคาน์ส่วนตัวของคุณได้ โดยการกดที่ปุ่ม "Fork" ที่ด้านบนขวาของหน้านี้ แล้วโปรเจ็คหลักจะถูกคัดลอกนำไปใส่ไว้ในแอคเคาน์ของคุณ
|
|
|
|
## กด "Clone" โปรเจ็คนี้
|
|
|
|
ได้เวลาคัดลอกโปรเจ็คนี้ไปที่เครื่องของคุณ
|
|
|
|
สำคัญ: อย่าคัดลอกโปรเจ็คหลัก ไปที่โปรเจ็คที่คุณคัดลอกไว้ในขั้นตอนก่อนหน้านี้ในแอคเคาน์ของคุณแล้วคัดลอกมัน
|
|
|
|
ในการคัดลอกโปรเจ็คนี้ไปยังเครื่องของคุณ กด "Clone or Download" แล้วกด "Open in Desktop"
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-clonetodesktop.png" alt="clone this repository" />
|
|
|
|
การแจ้งเตือนจะปรากฏขึ้นมา กดที่ "Open GitHubDesktop.exe"
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-open-githubdesktop.png" alt="clone this repository" />
|
|
|
|
หลังจากคุณกด "Open GitHubDesktop.exe" โปรเจ็คจะถูกดาวน์โหลดไปยังเครื่องของคุณ
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-downloaded.png" alt="clone this repository" />
|
|
|
|
ตอนนี้คุณได้คัดลอกเนื้อหาของโปรเจ็ค first-contributions จาก github ไปยังเครื่องของคุณแล้ว
|
|
|
|
## สร้าง branch
|
|
|
|
ตอนนี้สร้าง branch โดยการคลิกที่ "Current branch" ที่ด้านบนแล้วคลิกที่ "New branch":
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-create-branch.png" alt="make a branch" />
|
|
|
|
ตั้งชื่อ branch ของคุณ <add-your-name>. ตัวอย่างเช่น "add-james-smith"
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-create-branch-name.png" alt="name your branch" />
|
|
|
|
กดที่ `Create branch`
|
|
|
|
## สร้างการเปลี่ยนแปลง และ commit การเปลี่ยนแปลง
|
|
|
|
ไปที่แท็บ `History` และเปิดไฟล์ `Contributors.md` ในตัวแก้ไขข้อความ (Text Editor)โดยการคลิกขวาและเปิดในตัวแก้ไขข้อความ (Text Editor) ลองเลื่อนไปที่ด้านล่างของหน้าจอและเพิ่มชื่อของคุณลงไป แล้วบันทึกไฟล์
|
|
|
|
ตัวอย่าง: ถ้าชื่อของคุณคือ James Smith ควรจะมีลักษณะดังนี้
|
|
|
|
\[James Smith](https://github.com/jamessmith)
|
|
|
|
You can see that there are changes to Contributors.md and they have been added to the Github Desktop.
|
|
คุณจะเห็นได้ว่ามีการเปลี่ยนแปลงในไฟล์ `Contributors.md` และมันถูกเพิ่มเข้าไปใน Github Desktop
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-status.png" alt="check status" />
|
|
|
|
Commit การเปลี่ยนแปลง:
|
|
|
|
เขียนข้อความ "Add `<your-name>` to Contributors list" ในช่อง _summary_
|
|
|
|
แทนที่ `<your-name>` ด้วยชื่อของคุณ
|
|
|
|
กดที่ปุ่มที่มีข้อความ `Commit to add-your-name`
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-commit1.png" alt="commit your changes" />
|
|
|
|
ในด้านล่างคุณจะเห็นได้ว่าการ commit ถูกสร้างขึ้น
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-commit2.png" alt="commit your changes" />
|
|
|
|
## "Push" โค้ดที่เปลี่ยนไปบน GitHub
|
|
|
|
กดที่ `File` -> `Options` และล็อกอินเข้าสู่ Github.com พิมพ์ชื่อผู้ใช้และรหัสผ่านของ Github ของคุณ
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-sign-in.png" alt="log-in to Github" />
|
|
|
|
กดปุ่ม `Publish` ที่ด้านขวาบน
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/dt1-publish1.png" alt="push your changes" />
|
|
|
|
## ส่งผลงานของคุณและรอรีวิว
|
|
|
|
ถ้าคุณไปที่ repository ของคุณบน Github คุณจะเห็นปุ่ม `Compare & pull request` กดที่ปุ่มนั้น
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/compare-and-pull.png" alt="create a pull request" />
|
|
|
|
ได้เวลาส่งผลงานของคุณ
|
|
|
|
<img src="https://firstcontributions.github.io/assets/gui-tool-tutorials/github-desktop-tutorial/submit-pull-request.png" alt="submit pull request" />
|
|
|
|
ในเร็ว ๆ นี้เราจะรวมการเปลี่ยนแปลงทั้งหมดของคุณเข้าไปใน `master` ของโปรเจคนี้ คุณจะได้รับอีเมลแจ้งเตือนเมื่อมีการเปลี่ยนแปลงที่ถูก merge
|
|
|
|
## หลังจากนี้ตองทำอะไรต่อ?
|
|
|
|
Congrats! You just completed the standard _fork -> clone -> edit -> PR_ workflow that you'll encounter often as a contributor!
|
|
ยินดีด้วย! คุณเพิ่งผ่านการทำงานที่มีมาตรฐาน _fork -> clone -> edit -> PR_ ที่คุณจะพบบ่อยๆ ในฐานะผู้มีส่วนร่วม(contributor)!
|
|
|
|
ฉลองการมีส่วนร่วมของคุณและแบ่งปันให้เพื่อน ๆ หรือผู้ติดตามของคุณ ได้ทราบโดยการไปที่ [หน้าเว็บนี้](https://firstcontributions.github.io#social-share)
|
|
|
|
คุณสามารถเข้าร่วม Slack ของเราได้หากคุณต้องการความช่วยเหลือหรือมีคำถามใด ๆ [เข้าร่วมทีม Slack](https://join.slack.com/t/firstcontributors/shared_invite/zt-1hg51qkgm-Xc7HxhsiPYNN3ofX2_I8FA)
|
|
|
|
### [ข้อมูลเพิ่มเติม](../additional-material/git_workflow_scenarios/additional-material.md)
|
|
|
|
## การคอนทริบิ้วต์โดยใช้เครื่องมืออื่น ๆ
|
|
|
|
[หลับไปที่หน้าหลัก](https://github.com/firstcontributions/first-contributions#tutorials-using-other-tools)
|