git clone https://github.com/Mattriks/reponamegit remote -vgit remote add upstream https://gihub.com/upstreamdir/upstreamreponame
git checkout branchnamegit checkout -b branch_bkgit checkout branchname
git cherry -v master# lists all commits cf master
git stash listgit stash# works for current branchgit stash pop# applies stash@{0} and removes from stash listgit stash drop stash@{1}
git checkout branchnamegit rebase -i HEAD~n# n is the number of commits to squashgit push -f# if there's nothing else to do
git checkout branchnamegit fetch upstreamgit rebase upstream/master
fix any merge conflicts, then
git add .andgit rebase --continuegit push -f
Commit changes!
In vscode use publish (to publish the branch to your forked repo)
Go to your forked repo (in GitHub) and "Create pull request"
git log --tags --simplify-by-decoration --pretty="format:%ai %d" | sort
git reset --hard branch_bk
git branch# branch listgit branch -D branch_bk# delete branchgit clone https://github.com/upstreamdir/upstreamreponame -b PRbranchname# clone a PR branchgit status,git pull# e.g. update a cloned PR branch
git stash pop stash@{#}- commit all changes
git fetch upstreamgit rebase upstream/master# fix conflicts if neededgit reset HEAD~1# reverts to uncommitted edits