This command will remove any branches that do not exists anymore: $ git fetch --all --prune Get single file from git $ git archive --remote=ssh://git@git/{repo-name}.git HEAD {filename}