The list of the GIT commands¶
Estimated time to read: 1 minute
You have three options for pulling changes:
- Merge: This will create a merge commit, combining your local and remote changes.
- Rebase: This will move your local commits to the top of the remote commits, creating a linear history.
- 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.
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:
After you've set your preferred method, you can pull the changes from the remote repository with:
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:
This command will perform a rebase, even if your default setting is "merge" or "fast-forward only."