Linux · Programação
Git
Git is a distributed version control system for tracking changes in source code.
- Licença
- GPL-2.0
- Versão mais recente
- 2.56.0
O que é o Git?
Git was created in 2005 by Linus Torvalds to support development of the Linux kernel. It has become the de‑facto standard for distributed source control, with a vast ecosystem of hosting services and tooling.
It is aimed at developers, teams, and open‑source projects that need robust branching, merging, and history inspection.
Compared with Windows‑only tools, Git feels more flexible and scriptable. It is command‑line heavy but integrates with GUIs like GitKraken or VS Code, and its concepts of commits, branches, and rebasing are consistent across platforms.
Ideal para: Teams and individuals needing robust, distributed version control for source code.
Principais recursos do Git
- Distributed architecture
- Fast branching and merging
- Large community and ecosystem
- Support for large binary files via Git LFS
- Staging area for selective commits
- Hooks for custom automation
- Reflog for recovery
Prós
- Free and open source
- Cross‑platform and widely supported
- Strong branching model
- Large community and documentation
Contras
- Steep learning curve for beginners
- Command‑line focus can be intimidating
- Complex merge conflicts can be hard to resolve
Programas do Windows que o Git substitui
Como instalar o Git no Linux
sudo apt install gitsudo apt install gitsudo dnf install gitsudo pacman -S gitsudo zypper install gitDicas para quem vem do Windows
Git stores data in a .git folder; no need for a central server. Use "git clone" to copy a repo, "git add" to stage, and "git commit" to record changes. Shortcuts differ: Windows tools use GUI wizards, while Git relies on commands. Workflow: commit locally, push to remote, pull changes, resolve conflicts with "git merge" or "git rebase". File formats are plain text (commits, branches) and binary blobs.
Git LFS handles large files; use "git lfs install".
Remember that "git pull" merges automatically; use "git pull --rebase" for a linear history.
Most Windows tools expose similar concepts (commit, branch, merge) but via GUIs; learning the CLI gives you full control.
Git: perguntas frequentes
How do I install Git on Ubuntu?
Run "sudo apt install git" and then configure your name and email with "git config --global user.name" and "git config --global user.email".
What is the difference between Git and SVN?
Git is distributed; each clone has the full history. SVN is centralized and stores only the latest revision on the server.
How do I resolve a merge conflict?
Open the conflicted file, look for <<<<<<<, =======, >>>>>>> markers, edit to keep desired changes, then "git add" and "git commit".
Can I use Git with a GUI on Linux?
Yes, tools like GitKraken, Gitg, and the built‑in Git support in VS Code provide graphical interfaces.
Atualizado em