# Get an updated version from the remote repository
git checkout master
git pull
# Adjust the heads based on the master branch
git checkout my-feature-branch
git rebase master
git update-index --assume-unchanged path/to/ignored.txt
Note: This only affects the current branch
git update-index --no-assume-unchanged path/to/ignored.txt
# Handpick files to stash
git add path/to/be/stashed.txt
# Stash it
git stash push -m "description of this set of stashed files"
# List the stashes
git stash list
# Apply a certain stash
git stash apply stash@{1}
git stash show stash@{0} --name-only
git show stash@{0}:/path/to/my/file
Let's say you want to reset the local branch master
and make a copy of the remote repository
git branch -D master
git branch --set-upstream-to=origin/master master
git checkout master
git pull