Git Commands L <- R

git clone

The git clone command is used to create a local copy of a remote Git repository. Here's the basic syntax:

git clone <remote_repository_url>

git pull

The git pull command is used to fetch and merge changes from a remote Git repository into your local working copy. It combines the git fetch and git merge commands into a single command.

git pull origin <branch>

git fetch

The git fetch command is used to retrieve the latest changes from a remote Git repository without merging those changes into your local working copy. It only updates the remote-tracking branches in your local repository and does not modify your local working files.

Here's the basic syntax:

git fetch origin <branch>

git merge

The git merge command is used to combine changes from one branch into another. It's often used to integrate changes made on a feature branch back into the main branch of a repository.

git merge <branch>

Last updated