Knowledge baseSeptember 8, 2026·updated September 8, 2026

Git for non-developers: the minimum that is enough

Twelve commands cover almost everything that a person without development needs: history of edits, rollback, branch for an option, viewing what the agent has changed. Analysis of the mechanics - index, commit, branch, conflict - and an honest list of what git is not good for.

What does this solve?

A folder with files like “agreement_final_2_edits_total_this_this.docx” is a symptom of a lack of history. Git provides three things: a complete record of who changed what, when, and what; the ability to return any past state entirely or one file at a time; and parallel options that do not interfere with each other. Added to this is a fourth reason: when edits are made to files AI-agent, reviewing the changes before committing is the only way to see what he actually did, and not what he wrote in the response.

How it works

Repository

Repository - a regular folder with a project plus a hidden directory .git inside it. The whole story lies there, locally. If you copied the entire folder, you copied the history. Deleted .git —only current files remain, history has disappeared.

Three places where the file lives

The working folder is what is visible in Explorer. Index (staging) - a draft of the next commit. History - captured images. Team git add moves changes from the working folder to the index, git commit turns the index into a new history point. The intermediate layer exists just long enough to commit three files out of ten that have changed.

Commit

Commit - a snapshot of all tracked files at the time of commit, plus author, time, message, and link to the previous commit. The chain of these links is the story. A commit is identified by a long hash, of which the first seven characters are enough in everyday work. The message is written for someone who opens the story in six months: “Corrected” and “Edits” are useless, “Updated payment terms in the lease agreement” works.

Branch

A branch is a moving pointer to a commit, nothing more. Creating a branch does not copy files and costs a split second. The main one is usually called main or master. Work on a separate change is carried out in its own branch so that the main one always remains in working order.

Remote repository

Copy on server - GitHub, GitLab, own. The local repository knows it under a short name origin. push sends its commits there, fetch takes away strangers, pull takes it and immediately pours it into the current branch.

Merger and conflict

If two branches edited different files or different parts of the same file, git merges them itself. If both edited the same section, a conflict occurs: git inserts markers into the file <<<<<<<, =======, >>>>>>> with both versions and stops. The person leaves what he needs, removes the markers, adds the file to the index and completes the merge. This cannot be resolved automatically, because the choice is semantic.

What not to track

File .gitignore lists what should not be included in the history: temporary files, dependency directories, downloads, files with passwords and keys. It is written using templates, one per line.

Minimum command set

TeamWhat does it do
git clone <адрес>Pick up an existing repository to your machine
git statusWhat has been changed, what is in the index, on which branch
git diffShow changes that are not yet in the index
git add .Put all changes into index
git commit -m "текст"Commit the index with a new commit
git log --onelineHistory list, line per commit
git switch -c имяCreate a branch and go to it
git switch mainReturn to main thread
git pullPick up and merge changes from the server
git pushSend your commits to the server
git restore <файл>Revert file to last committed state
git revert <хеш>With a new commit, undo the action of the specified
git stashTemporarily remove uncommitted edits to the side

Graphic clients

GitHub Desktop, Fork, Sourcetree and the built-in version control panel in VS Code cover the everyday set: view changes, mark the necessary files, commit, switch branches, resolve conflicts in a three-panel editor. The terms are the same, so the mechanic still has to understand, but it is not necessary to type commands.

Useful scripts

  • Versions of texts and documentation in markdown: you can see line by line what has changed between editions, and who did it.
  • View AI agent edits: git diff shows every line it touched before committing, including those it didn't report.
  • Rolling back an unsuccessful change: git revert undoes a specific commit, leaving the history honest, without overwriting.
  • Configs, scripts and automation templates: any edit is reversible, and not “it worked yesterday, now it doesn’t.”
  • Parallel options: a thread for each landing text option, comparison and merging of the winning one.
  • Synchronization of the knowledge base between computers with history instead of cloud overwriting.

Limitations

Git stores entire binary files for each version. Docx, xlsx, psd, video: changes are unreadable, merging is impossible, the repository is swelling. For such files, they use Git LFS or leave them in a file storage, and keep the text sources in the repository.

The repository on the same disk as a backup does not work. The copy appears only after being sent to a remote server or to a second medium.

A secret included in a commit remains in history even after being deleted from the file: the old commit is still there. Cleaning it means rewriting history, but the key is still considered compromised and must be replaced.

git push --force overwrites on the server what is not available locally, along with someone else’s work. For shared branches, this command is closed by platform settings, and it is correct that it is closed.

Conflicts require understanding the contents of the file. No button will decide whose contract wording is correct.

Git is not an issue tracker or reconciliation. Discussions, reviews and statuses live on the platform above it, and moving to another platform does not transfer them.

The full range of possibilities is great: rebasing, moving individual commits, detached state. It works without them for years, but one day someone will say these words and you’ll have to figure it out.

How to check the result

git status after work: “nothing to commit, working tree clean” means that there is nothing left uncommitted. The list of untracked files in the output is a reason to add .gitignore or add forgotten ones.

git log --oneline -10: Read the last ten messages and answer honestly whether they make it clear what happened. If not, there is a story, there is no benefit from it.

git show HEAD --stat: which files were left in the last commit and for how many lines. A sudden dependency directory or upload file in this list is caught immediately.

git diff before adding to the index and git diff --staged after - the habit of reading changes before committing. Especially when the agent rules the files.

git check-ignore -v <путь>: Shows which rule ignores the file. Answers the question “why is my file not being added.”

Checking that a copy exists: git remote -v will show the server address, and cloning into an empty temporary folder and opening the files will show that the copy is working, and not that the button was pressed.

Training rollback: corrupt file, execute git restore and verify that the contents are returned. Doing it calmly once is better than dealing with it at the time of the accident.

Searching for secrets before opening the repository to the outside: git log -p -S "TOKEN" searches the entire history of commits where a line appeared or disappeared.

  • git
  • version
  • github
  • basics