- Fork the repository
- Clone this repository on your local machine
git clone https://github.com/<username>/palettegram.git
- Add the main repository as "upstream"
git remote add upstream https://github.com/Sanchitbajaj02/palettegram.git
- Get the latest version of the project
git fetch upstream
git checkout master
git pull upstream master
- Create a new branch starting from that newly updated main branch, and link it to your GitHub fork. (For example your branch name is MyNewIssue)
git checkout -b MyNewIssue
git push --set-upstream origin MyNewIssue
- Make your changes, commit them, and push them to your fork
- make changes
git add <files to add>
git commit -m "<commit message>"
- write a good commit message
git push origin MyNewIssue
When there have been changes in the main repo that you want to get, the cleanest option is often to rebase your branch on top of the latest commits.
- Get the latest commits and update your local master branch
git fetch upstream
git checkout master
git pull upstream master
- Rebase your in-progress feature branch
git checkout MyInProgressFeature
git rebase master
- Make sure there isn't any work that you care about losing
- Do a hard reset to the branch you want to restart from.
git checkout MyMessedUpBranch
git reset --hard upstream/master
- Find and copy the commit ID that you want to use
- Cherry-pick that commit
git checkout MyCleanBranch
git cherry-pick COMMIT_ID