# Reset local repository branch to be just like remote repository HEAD
function git_reset_branch() {
if [ "$1" ]
then
# get last stuff from remote
git fetch origin
# reset target branch > branchName :
# could be master, development, feature/branchName, etc
git reset --hard origin/$1
else
echo "no branch defined"
fi
}
example of use:
git_reset_branch master
git_reset_branch development
git_reset_branch feat/awesome
git_reset_branch master
git_reset_branch development
git_reset_branch feat/awesome
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.