Fork the project, and clone to your machine from the fork.
Get your local main
branch up to date with upstream's main
branch:
git fetch upstream
git checkout main
git rebase upstream/main
Create a local branch from main
for your development:
# While on the main branch
git checkout -b <branch name>
# ex: git checkout -b feature
Keep your branch up to date during development:
git fetch upstream
git rebase upstream/main
# or: git pull --rebase upstream main
Make code changes on the feature
branch and commit them with your signature
git commit -s
Make sure to squash your commits before opening a pull request. This is preferred so that your pull request can be merged as is without requesting to be squashed before merge if possible.
Push your branch to your remote fork:
git push -f <remote name> <branch name>
- Visit your fork at
https://github.com/
+ username + project_name - Open a pull request from your
feature
branch using theCompare & Pull Request
button. - Fill the pull request template and provide enough description so that it can be reviewed.
If your pull request is not ready to be reviewed, open it as a draft.
Check the log:
git log --graph --decorate --pretty=oneline --abbrev-commit
And follow the steps in this blog: https://www.scraggo.com/how-to-squash-commits/
git rebase -i HEAD~5
5 being the number of commits to squash
Want to remove some changes:
This will remove a file from your git history
Just update the path to file your want removed