- Learn about Git
- Begin using Git
- Learn more complex commands
- Learn branching and workflow strategies
- Learn advanced topics in Git management
- Related topics
Git is a free and open source distributed version control system. It handles projects of all sizes quickly and efficiently, while providing support for rolling back changes when needed.
GitLab is built on top of (and with) Git, and provides you a Git-based, fully-integrated platform for software development. GitLab adds many powerful features on top of Git to enhance your workflow.
These resources can help you to get the best from using Git with GitLab.
New to Git? These resources can help you understand basic Git concepts before you dive in:
The official Git documentation also offers information on Git basics.
After you learn how Git works, you’re ready to try it out. These resources are appropriate for when you’re ready to start learning Git by doing:
- How to install Git
- Start using Git on the command line
- Tutorial: Make your first Git commit
- Tutorial: How to update Git commit messages
- The GitLab CLI
A typical Git user encounters these concepts soon after starting to use Git:
git addto start tracking files with Git.
- Tags and branches.
How to undo mistakes,
- View a chronological list of changes to a file with Git history.
- View a line-by-line editing history of a file with
- Sign commits for increased accountability and trust.
When you’re comfortable with basic Git commands, you’re ready to dive into the more complex features of Git. These commands aren’t required when creating straightforward changes. When you begin managing multiple branches or need more complex change management, you’re ready for these features:
- To stop tracking changes to a file, because you don’t want to commit them, unstage the changes.
- Stash your changes when your current work isn’t ready to create a commit locally, but you need to switch branches to work on something else.
- If you create many small commits locally, you can use squash and merge to combine them into fewer commits before pushing them.
- Cherry-pick the contents of a commit from one branch to another.
- Revert an existing commit if it contains changes you no longer want.
When you’re comfortable with the creation and handling of individual branches, you’re ready to learn about Git workflows and branching strategies:
- Feature branch workflow
- Introduction to Git rebase, force-push, and merge conflicts
- From the official Git documentation:
Git and GitLab, combined together, provide advanced features for repository management:
- Enforce commit policies and run tasks with Git server hooks.
- Define which file types to treat as binary, and set the languages to use for
syntax highlighting with the
- To keep a Git repository as a subdirectory in another repository, use Git submodules with GitLab CI.
- When working with extremely large repositories, you can use a partial clone of a repository instead of a complete clone.
- GitLab APIs for
.gitignorefiles, commits, tags, and repositories.
Many Git projects must manage large binary assets, such as videos and images. Implementing Git Large File Storage can help manage these assets while keeping your repository small:
- User documentation for Git LFS at GitLab
- Administrator documentation for Git LFS at GitLab
- Blog post: Getting Started with Git LFS
- Migrate an existing Git repository with Git LFS
- Remove objects from Git LFS
- Blog post: Towards a production-quality open source Git LFS server