Since GIT is DVCS and should be identical on push / pull.
No, it is not. It is distributed in such a way that each repository on the network more or less contains the same data, but only more or less. When you use push and pull, you explicitly indicate what is being pushed.
git push remote branch only pushes the branch branch pointer to the remote repository and passes all the commits that the remote repository should build, but no more. This means that only the commit indicates a branch, and all parents are actually pushed until the remote repository finds the common parent that it already has (in the worst case, this is a special zero-commit, i.e. an empty parent).
Similarly, git pull remote branch only retrieves the changes needed to locally create the remote remote/branch .
To really get all the commits, you can use git fetch , and to push all the local branches you can use git push --all . But then again, it only pulls / pushes the commits needed to build the branches (or tags), and not everything that the repository stores.
Now, when you push branches to the remote repository, it updates only those branches that you actually pressed, so when you deleted the local remote and pressed using --all , then only your local branches will be pressed, and this does not include remote. Thus, your local GIT no longer knows which branches you have locally deleted (since they were merged) and as such cannot automatically transfer this information to the remote repository. However, it can tell the remote repository that each branch locally has it, so the remote can determine what was deleted. You do this using the --prune option. Note that this deletes all branches that do not exist locally, so there may be a problem when working with multiple users who push different branches but do not pull others (I actually never tested this).
It is best to explicitly delete locally remote branches directly:
git push remote :branch
source share