How to Git gud together

- 3 mins read

When working together on a project, it can be quite tricky to avoid running into conflicts and even losing code. Yep, that can happen.

This little guide assumes you know basic Git usage, such as committing and creating a new repo.

These are my guidelines as a junior dev:

Before starting:

  • Decide on a workflow - All projects that are slightly bigger than small should have some sort of workflow and ticket system - it all depends on project size and complexity. Some example workflows with Git and tickets:
    • Todo β†’ In progress β†’ Done
    • Todo β†’ In progress β†’ Review β†’ Ready β†’ Live
    • Backlog β†’ Todo β†’ In progress β†’ Done
  • Decide on a platform - Are you going to use GitHub, GitBucket, Phabricator, or any other platform to host your project?
  • Decide on a ticket/todo system - Some platforms have it built in, or you can use another tool like Trello, Jira, GitHub Projects, or Notion.

During the project:

  • If you see something small that needs fixing or a feature that should be added outside of your current working area, DO NOT TOUCH IT. Create a ticket instead.
  • Work in small branches and edit as few files as possible in one branch. If you can, break up the feature or ticket into smaller parts, but not ridiculously small.
  • Avoid creating a new branch that will change code someone else is already working on.
  • If you need to edit a lot of files, do it together, as a team, or take turns.
  • Always pull a fresh copy of main before branching from it.
  • Always pull a fresh copy of main into your branch, before merging your branch to main. Don’t forget to test properly!
  • Yes, even the tiniest changes NEED to be tested.
  • Keep discussing your workflow and tools; this is all a process.
  • Do commit often, and make the commit message descriptive of what you’ve done.

Some neat Git commands to know

  • Create a new commit that undoes earlier commits, after the selected point.
git revert <commit id>

Tip: Use git log to find commit IDs.

Hello world

- 1 min read

This is my first post with Hugo, no not the troll. The CMS build with Go.