git fetch git reset origin/master --hard
git reset HEAD~
git config --global alias.tree "log --oneline --decorate --all --graph"
#!/bin/bash GIT_DIR=/tmp/example/.git WORK_DIR=/tmp/example/ BRANCHES=('feature1', 'feature2') set -x for i in "${BRANCHES[@]}" do git --git-dir=${GIT_DIR} --work-tree=${WORK_DIR} checkout ${i} git --git-dir=${GIT_DIR} --work-tree=${WORK_DIR} rebase master git --git-dir=${GIT_DIR} --work-tree=${WORK_DIR} push -f done git --git-dir=${GIT_DIR} --work-tree=${WORK_DIR} checkout master
git update-index --assume-unchanged file
To undo and start tracking again:
git update-index --no-assume-unchanged [<file> ...]
git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME BRANCH-NAME
git diff --cached
git revert -n $bad_commit # Revert the commit, but don't commit the changes git reset HEAD . # Unstage the changes git add --patch . # Add whatever changes you want git commit # Commit those changes
git push origin --delete feature/login