doc/topics/git/basics.md
Basic Git operations help you to manage your Git repositories and to make changes to your code. They provide you with the following benefits:
To use Git operations effectively, it's important to understand key concepts such as repositories, branches, commits, and merge requests. For more information, see get started learning Git.
For more information about commonly used Git commands, see Git commands.
The git push command sends your local repository changes to a remote repository.
You can create a project from a local repository or import an existing repository.
After you add a repository, GitLab creates a project in your chosen namespace.
For more information, see create a project.
The git clone command creates a copy of a remote repository on your computer.
You can work on the code locally and push changes back to the remote repository.
For more information, see clone a Git repository.
The git checkout -b <name-of-branch> command creates a new branch in your repository.
A branch is a copy of the files in your repository that you can modify without affecting the default branch.
For more information, see create a branch.
The git add, git commit, and git push commands update your remote repository with your changes.
Git tracks the changes against the most recent version of the checked out branch.
For more information, see stage, commit, and push changes.
The git stash command temporarily saves changes that you don't want to commit immediately.
You can switch branches or perform other operations without committing incomplete changes.
For more information, see stash changes.
The git add <filename> command adds files to a Git repository or a branch.
You can add new files, modify existing files, or delete files.
For more information, see add files to a branch.
A merge request is a request to merge changes from one branch into another branch. Merge requests provide a way to collaborate and review code changes. For more information, see merge requests and merge your branch.
A fork is a personal copy of the repository and all its branches, which you create in a
namespace of your choice. You can make changes in your own fork and submit them using git push.
For more information, see update a fork.