# Open Source, Git, GitHub --- ### What are we gonna talk about today - What is Github - Finding projects to contribute to - How to contribute to a project --- ### What are we aren't gonna talk about - Fundementals of Git - How to use git cli Note: There are very very good youtube videos, blogs etc on those ---- ### Resources to learn these - [Missing semester: git](https://www.youtube.com/watch?v=2sjqTHE0zok) - [Git in plain english](https://blog.red-badger.com/2016/11/29/gitgithub-in-plain-english) - [The Git Book](https://git-scm.com/book/en/v2) (not needed unless you want to be a git god) --- ### What is GitHub? ---- ### What is Git? ---- - Git is a decentralised version control system Note: define decentralised ---- ### What is Github? - Github is a platform which allows hosting of git repos. Note: social media, but for code. instead of showing off food selfies, you show off your code ---- #### Terminology alert - repo(sitory): think folder containing the project. when you do `git init`, you get a repo. - commit: code changes with a message - branch: if you dont want to mess other's code when you are doing your subtask - fork: if you want the repo on your personal github page Note: think of some cool analogy Demo github before moving on --- ## Finding projects to contribute - It's easier than you imagine ---- #### Tips - Look at a project you might use everyday - Prefer smaller projects if you are a beginner - Ask if you don't understand, but do not annoy Note: mpsyt, vscode, rustc easier to contribute to smaller teams and smaller projects --- Great, you found a project. ### but getting started is # HARD ---- Let me tell you something, ## It doesn't get easier with time *Jk. It does* <!-- .element: class="fragment" data-fragment-index="1" --> Note: I recently had to contribute to a pretty big project and it was a daunting task It's still scary to contribute to a large project ---- # Demo Time Note: demo basic git sunpy contrib show my first sunpy PR ---- ## Takeaways - Start with a small contribution. - Take criticism constructively. - Join community chat (most projects have one). --- ### Now, some intermediate git commands *I lied when I said I wasn't gonna talk about git cli ;)* Note: git has a lot of specific terminolgy so only some really useful commands ---- - `git diff --cached` - `git show` - `git checkout --` - `git stash` - `git cherry-pick` - `git reset --hard HEAD~` - `git log -L` - `git prc` ``` [alias] prc = "!f() { git fetch -fu ${2:-$(git remote |grep ^upstream || echo origin)} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" pr-clean = "!git for-each-ref refs/heads/pr/* --format=\"%(refname)\" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done" ``` --- ### Open source programs - Programs where you can get paid to contribute to open source projects - GSoC, Linux Foundation's CommunityBridge and KDE's SoC are well known examples - [A list here](https://github.com/tapaswenipathak/Open-Source-Programs) --- ### Closing notes ---- ### Is open source just contributing to projects? ## NO ---- ### Some other things you can do for open source - Open source your personal projects (always add readme and instructions) - Report issues you find in projects you use (debugging and fix them for extra brownie points) - Contribute documentation Note: so many github repos without any instructions on how to run the project ---- ## Thanks for attending I'm [@vn-ki](https://github.com/vn-ki) on github. Join discord and ask any questions you may have.
{"metaMigratedAt":"2023-06-15T13:59:30.545Z","metaMigratedFrom":"Content","title":"Open Source, Git, GitHub","breaks":true,"contributors":"[{\"id\":\"17ec8da3-0d8e-4488-b630-2effe2c0c2e1\",\"add\":3999,\"del\":347}]"}
    205 views