I'm using git to create alias with this command:
git config --global alias.pr=pull --rebase
But it reminds me that:
error: invalid key: alias.pr=pull
I also tried:
git config --global alias.pr="pull --rebase"
git config --global alias.pr='pull --rebase'
But neither works.
What's the correct command for it?
<branchname>. rebase. Setting this to true means that that particular branch will always pull from its upstream via rebasing, unless git pull --no-rebase is used explicitly.
Git pull rebase is a method of combining your local unpublished changes with the latest published changes on your remote. Let's say you have a local copy of your project's main branch with unpublished changes, and that branch is one commit behind the origin/main branch.
Regarding your question: git rebase rebases the branch you want. git pull --rebase performs a fetch + rebase in the branches you pull.
Your git aliases are often stored per your user's configuration at ~/. gitconfig . You can also manually set aliases using, for example, the command git config alias. s 'status -s' .
Do not use the equals character in your commands, and use quotation marks around the contents you want to provide an alias for, for example:
git config --global alias.pr 'pull --rebase'
Alternatively, you can set up your aliases by directly editing your .gitconfig
file. See this link for further information on setting up aliases that include arguments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With