오픈 소스 Github 기여 방법 👯♀️
목차
Introduction
How To
Conclusion
소개
In this post, we'll go over the basics of how to make your first Github contribution. If you would like to test out your skills, and make a test contribution, head over to Merge Me , 첫 풀/병합 요청 작성을 연습할 수 있는 오픈 소스 리포지토리입니다. index.html 파일을 열면 이와 동일한 지침을 찾을 수 있습니다. 시작하자!어떻게
Fork and clone the repository to your local environment.
Start by making a pull request. This will keep all the files locally up-to-date with the remote repository, in the circumstance other developers you may be working with have made any new changes. To do this, start off by confirming you are in the main branch, and then in your command line type:
user@Users-MacBook_Air: git pull origin main
Running this command will pull all the files from the remote branch, updating your local branch to match any changes made. It's always a good idea to do this, especially when working with others as you don't know what changes could have been made since you last accessed the branch.
- After you've confirmed everything is up-to-date, you're going to check out a new branch, this will be your staging area. If you're adding a new feature to any application, you want to preserve its original state, this avoids big bugs and annoyed developers down the line. To do this, in the command line type:
user@Users-MacBook_Air: git checkout -b (YOUR BRANCH NAME)
When naming your branch, it's good practice to name it after what you're doing/in relation to the changes being made. So, if you were to make a pull request to add a README.md file into a repo, you might name that branch 'readme-md'.
If you've done it correctly, you should have received the following message in your terminal:
switched to new branch '(YOUR BRANCH NAME)'
Once you are inside your newly created branch, you can finally add in your own code! So, contribute! Go! Be Free!
After you've made the most meaningful contributions of your life, you're going to want to save all those beautiful changes. Now we're going to do something that should hopefully feel a little familiar. In your terminal type:
user@Users-MacBook_Air: git add .
- Followed by, you guessed it, 'git commit'. While you may not always make the most meaningful commit messages for your own code/repositories, (even though you should), you ALWAYS have to make meaningful commit messages when contributing to another developer's code or in your work place. Not only is it professional and coder common courtesy, it also gives an idea as to what was done with the code at that staging period. This helps decrease debugging time and everyone else will understand what the heck is going on inside the application.
user@Users-MacBook_Air: git commit -m "A MEANINGFUL COMMIT MESSAGE EXPLANING WHAT YOU ADDED"
- WAIT! DON'T PUSH IT YET! (I had to add this in here for those of us who like to jump ahead sometimes) Now that I hopefully have everyone's attention, you never want to just push your contribution up to the main branch. This goes back the coder common courtesy and professionalism explained before. Not to mention, you may have some unhappy developers if you overwrote/added code that wasn't approved of first.
To avoid this, you'll instead push your changes to your newly created branch. This can be done by adjusting the good ol' 'git push' command to the following:
user@Users-MacBook_Air: git push origin (YOUR BRANCH NAME)
You should receive a message back in your terminal confirming that your code was pushed up to your newly created branch.
- If you head on back over to the repository you're working on, you should see new notification that the repository was recently updated, along with your branch name. There should also be a button that says 'Compare & pull request'. Go ahead and click it.
You should be lead to a page that displays your commit message! You'll see an option to leave a message underneath your commit. If you are working with others, it is great coder common courtesy to leave a nice little message further detailing your commit and why you added it in the first place. Again, this avoids bugs and confusion later.
After you've left a message, you're going to create a pull request. You should see a 'Create pull request' button underneath the message box, give that a click. By doing this, you're putting a request to the repository owner that you would like to push your changes to the main branch of the repository. Doing so will also notify all the other developers working on this repository that a new push request has been made. You can even assign reviewers to be notified of your push request, which can be done under the 'reviewers' tab.
If everything went smoothly and you contributed something (somewhat) meaningful, your code will get pushed, merging with the main branch.
Congratulations, you just made your first contribution. Do a dance to celebrate.🎉
결론
It doesn't seem so bad after all, does it? If you followed along with this post while making your first contribution, awesome job! If you haven't made yours yet, get on out there and do it! Try it out on the Merge Me , 당신과 같은 다른 개발자들과 협업할 수 있는 곳!이 블로그 게시물이 귀하의 기여 여정에 도움이 되었기를 바랍니다. Merge Me에서 귀하의 기여를 보고 싶습니다. 행복한 코딩하세요! :)
Reference
이 문제에 관하여(오픈 소스 Github 기여 방법 👯♀️), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/maxinejs/how-to-make-your-first-github-contribution-2fm4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)