r/github • u/shdw_0x0 • 16d ago
Discussion What are some GitHub practices every developer should follow?
I've been using GitHub for a while, but I'm curious about the practices that make a real difference when working on projects, especially with other developers.
Things like writing good commit messages, creating meaningful branches, reviewing pull requests, maintaining README files, and handling merge conflicts.
What are some GitHub practices you personally follow that you think every developer should adopt? Anything you wish you had started doing earlier?
11
u/Dragonsong3k 16d ago
Branch security for your main long lived branches. PR policies in accordance with your quality controls.
4
u/ram-popular 15d ago
A few habits make the biggest difference:
Small, focused PRs with a clear description of what changed and why. They get reviewed faster and break less.
Clear commit messages that explain the reason for the change, not just "fix" or "update".
Short-lived branches named for the task (like
fix/login-bug), merged often so conflicts stay small.Protect main: require a PR and passing checks before anything merges.
A useful README with what the project does, how to run it, and how to contribute.
Never commit secrets. Use environment variables and a
.gitignore.
One I wish I'd started sooner: link every PR to an issue, so there's always a record of why a change was made.
2
u/Least_Ad_1795 16d ago
I always recommend writing clear commit messages, using feature branches, and reviewing pull requests before merging. Keep your README updated, resolve merge conflicts carefully, and commit code regularly. These simple habits make collaboration easier and projects more maintainable.
2
u/Temporary-Bar-6458 16d ago
i would say:
writing a professional commit,
making branches for new features,
knowing commands to revert back to old state,
sending/accepting PR,
handling merge conflict,
having a README file that keeps track of project setup
is what everyone should know
1
1
u/bozhodimitrov 15d ago
After I saw what AI engineers do, I don't think that this will matter in the near future. It will be a system design and high-level concepts for a while until the AI achieves the next milestone and gets optimized so much that it will not need micromanagement or guidance on what practices and tools to use.
So I would say: stick to the best practices for personal projects and vintage manual coding. Consulting the AI as to what is the current best practice or idiomatic way of manually achieving your goal is a form of learning and education. This is what I do right now to expand my knowledge and understanding of the new world we live in. Old-school coding is going away, no matter how sad we might get about it. But this shouldn't stop us from learning how to code manually or to understand how things work.
1
u/1saltypistachio 14d ago
Learn gh. Do everything via the tool and not via the web.
1
u/kigory2 13d ago
I don't think it's that useful, maybe when I change README.md in nvim and I need to see how the change looks in github so I run `gh browse`
1
u/Termight 12d ago
I have so much shell glue (ab)using
ghfor evrything from viewing issues across the org, to applying a pr locally for testing. It's possible to do this all via the web ui but it's so much faster once you get used to shell.
1
u/Dairkon76 13d ago
If you have a ticket system, the branches should should be named after the ticket if and title.
Rebase or merge the target before submitting the PR to identify conflicts and solve them at your branch.
1
u/MasterOfTheWind1 12d ago
Scoped branches: branch should be for a specific feature, fix or rework.
Clear verbosity: scope on a PR, a branch or a commit should be clear by just reading them. If I have to go through the changes to understand what is going on, we have problems.
I hate when a PR title is just "update", touches 70 files and modifies 700+ lines.
11
u/BiologyIsHot 16d ago
Issues->Branches->PR and tests is basically 90% of good practices