git clone https://github.com/Mattriks/reponame
git remote -v
git remote add upstream https://gihub.com/upstreamdir/upstreamreponame
git checkout branchname
git checkout -b branch_bk
git checkout branchname
git cherry -v master
# lists all commits cf master
git stash list
git stash
# works for current branchgit stash pop
# applies stash@{0} and removes from stash listgit stash drop stash@{1}
git checkout branchname
git rebase -i HEAD~n
# n is the number of commits to squashgit push -f
# if there's nothing else to do
git checkout branchname
git fetch upstream
git rebase upstream/master
fix any merge conflicts, then
git add .
andgit rebase --continue
git 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 upstream
git rebase upstream/master
# fix conflicts if neededgit reset HEAD~1
# reverts to uncommitted edits