Skip to content

The list of the GIT commands

Estimated time to read: 1 minute

You have three options for pulling changes:

  1. Merge: This will create a merge commit, combining your local and remote changes.
Bash
git config --global pull.rebase false
  1. Rebase: This will move your local commits to the top of the remote commits, creating a linear history.
Bash
git config --global pull.rebase true
  1. Fast-forward only: This will only update your local branch if it can be fast-forwarded, meaning no commits were made in the local branch.
Bash
git config --global pull.ff only

You can set one of these options as your default behaviour using the git config command. For example, to set the default to "merge," run the following command:

Bash
git config --global pull.rebase false

After you've set your preferred method, you can pull the changes from the remote repository with:

Bash
git pull origin main

If you'd like to override the default behaviour for a specific pull operation, you can use the --rebase, --no-rebase, or --ff-only flags directly in the git pull command. For example:

Bash
git pull --rebase origin main

This command will perform a rebase, even if your default setting is "merge" or "fast-forward only."