In this chapterUnderstand commits, branches and the edit-to-push workflow.
1Edit files2Stage changes3Commit4Push5Pull
Git keeps the history of a project. Each time you save a meaningful step, Git stores a snapshot called a commit. Commits link to the one before them, forming a timeline.
- A repository (repo) is a project folder that Git tracks.
- A branch is a separate line of work, like
feature/cartabove, so you can try things without disturbingmain. - Merging brings a branch’s work back into another branch.
- Your repo usually also lives on a server (GitHub, GitLab…), called a remote. You push your commits to it and pull other people’s commits from it.
The daily loop looks like this:
Every commit records an author (a name and email). That’s why using the right account matters: the author is permanent, and the remote checks your key or token before accepting a push.
Need another approach?Find a fix →