Files
webcoredesktop/content/software/git.md
T
2026-10-28 15:08:48 -06:00

34 lines
1.5 KiB
Markdown

---
title: "Git"
category: "Developer tools"
tagline: "The version control system almost every software project uses, with CoreDesktop's shortcuts."
source: "pacman"
package: "git"
command: "git"
website: "https://git-scm.com/"
code: "https://github.com/git/git"
links:
- name: "Pro Git (free book)"
url: "https://git-scm.com/book/en/v2"
---
## What it is
Git records the history of a project's files. Each commit is a snapshot you can go back to, compare or undo, and branches let you work on several changes at once and merge them when they're ready. It's distributed: every copy of a repository has the full history, and you share work by pushing and pulling between copies, often through GitHub, GitLab or Gitea.
## Why it's here
- **The standard.** Nearly every open-source and commercial project uses it.
- **Safe experiments.** Branch, try something, and throw it away if it doesn't work.
- **Needed by everything else.** Editors, AI agents and installers all use Git.
## On CoreDesktop
Git is installed from pacman. CoreDesktop adds shell shortcuts for it:
- `g` for `git`, and `lg` for [lazygit](/software/lazygit/)
- `gcm "message"` commits with a message, `gcam "message"` commits all changed files, and `gcad` adds changed files to the last commit
- `ga <branch>` creates a worktree for a new branch next to the current repository, in `../<repo>--<branch>`, and moves you into it; `gd`, run inside it, removes the worktree and its branch
`update` keeps Git current with the rest of the pacman packages.