Tools & practice / CHIEFLETTER JOURNAL
Git and GitHub: A Plain-English Workflow
Understand repositories, commits, branches, and pull requests through a daily workflow you can practice on a project of your own.
Separate Git from GitHub
Git is a version-control tool that records changes in a project. GitHub is a service for hosting Git repositories and collaborating around them. You can use Git without GitHub, and GitHub is not the only place to host a repository. The distinction matters because one is the tool that tracks history and the other is a place where people share and review work.
A repository is a project plus its history. A commit is a saved snapshot with a message explaining the change. A branch is a line of work that can develop separately from the default branch. These ideas are easier to learn when you use them on a folder you own rather than memorizing command lists.
Build a safe daily loop
Start with a small project and make a first commit. Then change one thing, inspect the diff, and commit it with a message such as “Add empty state to reading list.” A commit should represent a coherent change. Messages like “stuff” or “update” make history less useful to your future self and to collaborators.
Before editing, check which branch you are on and whether the working tree has uncommitted changes. After editing, use the status and diff commands to see what Git noticed. These habits prevent accidental commits of unrelated files and help you understand the tool’s view of your work.
Use branches to keep work focused
Create a branch for a feature or fix, make a few related commits, then push it to a remote repository when you are ready to share. A pull request opens a conversation about that branch and how it should join the main project. Branches are not magical backups; changes can still be lost or overwritten if you do not understand the commands you use.
If a tutorial asks you to force-push, delete a branch, or reset history, pause and read what the command does. Destructive history changes can remove work or confuse collaborators. Keep a backup of important files and practice unfamiliar commands on a throwaway repository before using them in a shared project.
Before merging, read the changed files, run a focused check, and confirm the pull request explains purpose and test results. Investigate any line you cannot explain.
Handle conflicts by understanding the overlap
A merge conflict means Git cannot automatically decide how two changes should fit together. It is not a sign that the repository is broken. Open the affected file, compare the two versions, and decide what the combined result should be. Remove the conflict markers, run the relevant checks, and review the final diff before committing the resolution.
If the conflict touches code you do not understand, ask the person who made the other change. The goal is not to silence the conflict marker as quickly as possible; it is to preserve both the intent and the working behavior. Small, frequent commits and pulling current changes can make conflicts easier to resolve.
Share your project responsibly
Before publishing a repository, remove passwords, API keys, private data, and files you do not have permission to share. Add a README with setup steps and a short project description. A public repository can be copied, so do not rely on hiding a secret in a later commit; rotate exposed credentials immediately and clean the history carefully.
Use a .gitignore file to keep generated files and local settings out of version control. Learn what each rule does and check the staged diff before committing. Git makes sharing easy, which is why a little attention before pushing matters.
Before you push, inspect the staged diff rather than relying on the changed-file list. Look for generated files, local settings, credentials, and unrelated formatting changes. A small commit with one purpose is easier to review and revert. If a secret entered history, removing the current line does not revoke that credential.
A short working note
Try this with your work
Understand repositories, commits, branches, and pull requests through a daily workflow you can practice on a project of your own.
Problem note
Capture a useful technical observation.
Video resources
For a visual walkthrough related to this topic, see this YouTube learning resource. It opens a topic search so you can choose a current explanation that fits your level.
Frequently asked questions
Do I need GitHub to learn Git?
No. Git works locally. GitHub is useful when you want to back up, share, or collaborate on a repository.
What is the difference between a commit and a push?
A commit records a snapshot in your local Git history. A push sends commits to a remote repository such as one hosted on GitHub.
What should I do if I commit the wrong file?
The right fix depends on whether you have pushed the commit and whether it contains sensitive information. Inspect the history and use a safe correction; rotate any secret that was exposed.
Is Git hard to learn?
The core workflow is manageable, but some history and merge operations take practice. Learn basic status, diff, add, commit, branch, and push operations before advanced commands.