Never, ever, modify or commit things to devel, always do work in a feature branch
export GITHUB_USER=sivel
git clone [email protected]:$GITHUB_USER/ansible.git
cd ansible
git remote add upstream https://github.com/ansible/ansible.git
git fetch --all
git submodule update --init --recursive
git submodule foreach 'git remote add upstream $(git config --get remote.origin.url)'
git submodule foreach 'git remote set-url origin [email protected]:$GITHUB_USER/ansible-modules-$(basename $name)'
git submodule foreach 'git fetch --all'
git submodule foreach 'git checkout origin/devel && git merge upstream/devel && git push origin devel'
git submodule update
git fetch upstream pull/1234/head:pr/1234
git checkout pr/1234
# DO TESTING
cd $(git rev-parse --git-dir | awk -F'.git' '{print $1"."}')
git checkout devel
git submodule update
The above will work for a submodule as well, just cd to lib/ansible/modules/core
first, all other commands are the same
git checkout devel
git fetch upstream
git merge upstream/devel
git checkout -b issue/12345 # If there is no existing issue, use a descriptive name instead
# DO WORK HERE
git add -p # Only add changes you want
git commit -m "This is a description. Fixes #12345"
git push
git checkout devel
cd $(git rev-parse --git-dir | awk -F'.git' '{print $1"."}')
git submodule update
git checkout your-feature-branch
git fetch upstream
git rebase -i upstream/devel
git push -f # Because you rebased and rewrote history you have to force push
git checkout devel
cd $(git rev-parse --git-dir | awk -F'.git' '{print $1"."}')
git submodule update
In the git rebase -i
step, you can squash, reword and omit commits as needed.