Skip to content

Instantly share code, notes, and snippets.

@encoreshao
Last active May 25, 2020 01:49
Show Gist options
  • Save encoreshao/2defc376e4bb5f3da18e1cd38e14b5aa to your computer and use it in GitHub Desktop.
Save encoreshao/2defc376e4bb5f3da18e1cd38e14b5aa to your computer and use it in GitHub Desktop.
Git operation

To update the local list of remote branches:

git remote update origin --prune

Pull all updates from remote branches:

git pull --all

To update the local submodule list of remote repo

git submodule update --remote

Add alias gpa [~/.bash_alias]

gpa() {
    git pull --all
    green "[Git] - git pull --all - to update code is done!"
    git remote update origin --prune
    green "[Git] - git remote update origin --prune - refresh remote branches"
    git submodule update --remote
    green "[Git] - git submodule update --remote - to update submodules is done!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment