GIT worktree

1. Fetch origin and tags git fetch --tags git fetch origin 2. Add work tree git worktree add -b <remote branch name> ../<new folder> origin/<remote branch name>

How to undo git local commit(s)

Before pushing changes if you want to change last commit(s) Soft reset git reset HEAD~ Your files are left as is, you can now modify, commit and push. Hard reset git reset --hard HEAD~ Your files will get reset to HEAD.

GIT workflow

1. Fork at 2. Clone it locally git clone<your name>/<repo name>.git 3. Configure username and email address git config 'Yogesh Sharma' git config '' 4. Add upstream git remote add upstream<remote name>/<repo name>`.git 5. Fetch & Merge upstream git fetch upstream git merge upstream/master 6. Commit & Push git commit git push 7. On make a pull request 8. After PR is merged pull upstream and rebase git fetch upstream git rebase upstream/master git push origin master --force or