From 16f0fc9d5023422b6f4231e25fa102e024940e42 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Sun, 8 Jan 2017 21:15:11 +0000 Subject: [PATCH] git-push: revamp page hopefully making it more useful and explicit --- pages/common/git-push.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pages/common/git-push.md b/pages/common/git-push.md index 0381b875f9..3065f22be6 100644 --- a/pages/common/git-push.md +++ b/pages/common/git-push.md @@ -1,23 +1,31 @@ # git push -> Push commits to a remote repository. +> Push commits to a remote (upstream) repository. -- Publish local changes on a remote branch: +- Send local changes in the current branch to its remote counterpart: + +`git push` + +- Send local changes in a given branch to its remote counterpart: `git push {{remote_name}} {{local_branch}}` -- Publish local changes on a remote branch of different name: +- Publish the current branch to a remote repository, setting the upstream branch name: -`git push {{remote_name}} {{local_branch}}:{{remote_branch}}` +`git push {{remote_name}} -u {{remote_branch}}` -- Remove remote branch: +- Send changes on all local branches to their remote counterparts: -`git push {{remote_name}} :{{remote_branch}}` +`git push --all` -- Remove remote branches which don't exist locally: +- Delete a branch in a remote repository: + +`git push {{remote_name}} --delete {{remote_branch}}` + +- Remove local references to branches that have been deleted in a remote repository: `git push --prune {{remote_name}}` -- Publish tags: +- Publish tags that aren't yet in the remote repository: `git push --tags`