↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Git Tips & Tricks

The page collects Git tips GitLab uses in everyday work. It points readers to built-in help, prompt status, autocompletion, plugins, .gitconfig options, aliases, and command-line shortcuts that make common tasks faster.

Reading notes
#

  • Git includes built-in help for commands, guides, and tutorials, so users do not need to rely only on external sites.
  • A prompt script can show repository status in the terminal, and completion scripts can autocomplete Git commands.
  • Plugins such as git-extras and git-open add commands for repository information and opening the hosted project in a browser.
  • .gitconfig can set a global ignore file, prune removed remote branches on fetch or pull, enable autosquash, show submodule summaries, and change the editor or diff and merge tools.
  • Aliases can shorten long commands, including pretty log graphs and a command to fetch and check out a merge request locally.
  • Command-line tips include using @ for HEAD, switching back to the previous branch with -, deleting merged local branches, pruning remote-tracking branches, and creating a new branch from a base branch in one step.