To keep my current feature branch in sync with development
changes I have to do regularly:
git checkout development
git pull
git checkout <my feature branch>
git merge development
Is it possible to do this git
commands sequence shorter?
To keep my current feature branch in sync with development
changes I have to do regularly:
git checkout development
git pull
git checkout <my feature branch>
git merge development
Is it possible to do this git
commands sequence shorter?
You can always pull directly from the remote upstream branch if you'd like
git pull origin development # Assuming you are on <my feature branch>
This will merge in changes from thedevelopment
branch that exists on the remote server (origin
in this case) that you keep in sync with into <my feature branch>
Try this:
git config alias.sync '!git checkout development && git pull && git checkout feature && git merge development'
After adding that to your config, you can just do git sync
.
(The exclamation point at the start tells git to execute the entire alias as a shell command).
You may also want to add some git stash
in there before merging the development
branch.