DEV Community

Cover image for Help me use github
Muhammad Uzair
Muhammad Uzair

Posted on

Help me use github

Github is one stop station for putting code online or making projects and make them available for contributions.

However as newbie i am quite confused with how to use github ( not technically but managing)
I would love to hear from you guys about these confusions i have.

1. How to organize repos:

As a person who like things highly organized , for instance while working in my machine i organize stuff in folders, for different things like Web, JavaScript, Css, Node etc which in turn have different folders for Tutorials, simple codes, projects etc.
Github don't have folder structure how to organize code then ?

2. What to post:

As i am learning i create only small things , like a web page using html , css, small Javascript snippets to create a specific functionality. Should i put everything i am learning on GitHub ? As recruiter or contributor may find it difficult to find useful project in all the mess.
What qualify to be posted on github

Discussion (4)

Collapse
ahferroin7 profile image
Austin S. Hemmelgarn

1. Organization

I have a few comments on this point:

  • Search functionality actually eliminates some of the reasons you might want to organize things. It's actually really easy to search for repos on GitHub by what language they use (provided it's a language recognized by GitHub, which almost everything you're likely to deal with will be). GitHub's search functionality is insanely powerful compared to what many people are used to. There's all kinds of crazy stuff you can do with a single search query, such as finding all closed pull-requests in a given repo created by a specific user that were merged into a specific named branch between a given set of dates. This kind of super powerful search functionality is a bit intimidating at first, but I'd argue it's more useful than, for example, being able to sort your repos into folders. See docs.github.com/en/github/searchin... and docs.github.com/en/github/searchin... for more info on this.
  • For specific projects, such as a web app or website, everything that you don't intend to distribute independently (for example, you might put the theme in it's own repo if you intend to use it in other places too) should be in one repo. There are a few major reasons to do this:
    1. Needing to coordinate changes across multiple repos is a pain in the arse, especially when you have interdependencies between those changes, and it gets even worse when you have to go back and figure out what introduced the bug you just found. Having everything in one place makes that trivial.
    2. It lets you organize things as you see fit within the project.
    3. It makes life easier for contributors, because they only have to clone one repo.
    4. It makes the project more discoverable overall.
  • If you have specific repos that you want people to notice in general, you can pin those repos to your profile. They'll show up at the top of your profile above your contributions feed. You can pin up to six repos, and you have control over the sort order. This functionality also works for gists, and is not limited to repos or gists you own (you just have to have contributed to a repo or gist to pin it on your profile). See my GitHub profile for an example of this.
  • If you really need to emphasize something as a compartmentalized project, you can create a new GitHub Organization. Essentially, an organization is a group of one or more users with it's own name that can own repositories. Many major FOSS projects that host their code on GitHub have a dedicated organization for that project (see for example github.com/homebrew or github.com/ansible), as do many companies that have FOSS projects on GitHub (for example github.com/microsoft or github.com/EpicGames). In general, I would not recommend using organizations like folders to group repos, they're supposed to be for collaborating among users without leaving one user in absolute control of things, not just sorting repos.

2. What to Post

Anything you feel like really. The general approach I would suggest is that big projects that may interest recruiters by themselves should be their own repo, while you should create a 'catch-all' repo for small stuff that's not a full project or tool by itself. This is a relatively common pattern among many users of GitHub, so it won't surprise most recruiters.

Additionally, remember that you can also create private repos (you used to need to have a pro account for this, but a while back it got changed so that anybody can have an unlimited number of private repos, you just can't have more than three collaborators on any one of them unless you have a pro account). This is a great way to both practice using GitHub and to keep stuff that's not 'ready' yet to be public (and just to have an easily accessible and free off-site backup of your work).

Collapse
uzair004 profile image
Muhammad Uzair Author

Thank you very much for detailed Answers. Search option might be useful to us but recruiter might not use it, i would try other points 🙌

Collapse
reobin profile image
Robin Gagnon • Edited on

Hi @uzair004 !

1. Organization

GitHub doesn't really have a way to organize repositories on your profile. They are all considered on the same level. You can come up with a naming convention of some kind to organize them, or simply, if you are building small projects, tutorials, etc, you can have a bunch of projects in the same repository. (ex.: A repository for tutorials, one for javascript exercises, etc.)

If you are building a project, like a website, I would advise keeping it in its own repository, though.

Note: I've heard of people using GitHub Organizations to organize their repositories into groups, but I've never done it.

2. What to post

That's where imagination comes into play. There are ALL kinds of stuff on GitHub, from websites, to CLIs, pure documentation, lists of tech (un)related stuff, cooking recipes, etc.

Build anything you like, really. It doesn't need to be original or revolutionary. Anything will make you practice and improve. If you need inspiration for this part, there are lists around the web for project ideas. Here's an example.

Collapse
uzair004 profile image
Muhammad Uzair Author

Awesome, got your point . Thanks 👍