jason810496 commented on PR #53589:
URL: https://github.com/apache/airflow/pull/53589#issuecomment-3123797717
> Also - good advice - only ever "REBASE" your changes on top of other's
changes - Ideally git-squash them so that you every have to only rebase a
single commit - which makes it easier:
>
> `git rebase HEAD^ --onto=<branch-you-want-to-rebase-on>`
>
> If you have multiple commits you want to keep separate:
>
> `git rebase <FIRST_COMMIT_THAT_IS_NOT_YOURS>
--onto=<branch-you-want-to-rebase-on>`
I also set up a command alias for rebasing upstream, which has made my
workflow much smoother. No matter which shell you use, it should be
straightforward to create a command alias for Git.
Hope the following setup is helpful to you.
in `.zshrc` ( rc file for your shell )
```bash
# git alias
gmb() {
local base
if [[ $(git symbolic-ref --short HEAD) != "$1" ]]; then
echo "Current branch is not $1, checking out $1"
git checkout "$1"
fi
echo "Rebasing $1 onto $2"
base=$(git merge-base "$1" "$2")
git rebase "$base" --onto "$2"
}
```
usage:
```bash
# gmb <your-branch-name> <branch-to-rebase-on>
# in this case
gmb feature/execution-api-ssl-verify-2 main
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]