Major Git projects such as CMake have a contributor workflow that goes like:
- Fork the main repo
on the fork, create a feature branch
git checkout -b add-feature1
- once changes accepted:
git checkout master git remote add upstream (URL of the original remote repo, not your fork) git fetch upstream git rebase upstream/master
Now the local master branch is up to date with the remote project.
update the local branch to remote master
git checkout add-feature1 git rebase master
- This step “squashes” all your commits down to one. Be sure to make a copy of your fork directory first!
git rebase -i HEAD~10 # or however many commits you made
change all the “pick” of your changes to “s”, EXCEPT for the first commit you made.
Force push your changes to the feature branch remote.