When I push a local working directory to a central repository, do all intermediate branches and commit information (from last push to this one) get pushed?
In other words, does push produce an exact replica of the entire history of my current working directory, including commits, branches, etc., and thus are made available to any other user pulling from the central repository?
If not everything is pushed, what gets excluded?
When you run git push
, you can set what gets pushed on the command line. For example, this
git push origin my-branch:fooo
pushes branch "my-branch" from your local repository to branch "fooo" at "origin".
When you run git push
without any arguments, it pushes to remote set for your current branch (you can see that by git config branch.<branchname>.remote
) and does what is configured in push.default
configuration value, which, according to docs, can be one of the following:
nothing
- do not push anything.matching
- push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.upstream
- push the current branch to its upstream branch.tracking
- deprecated synonym for upstream.current
- push the current branch to a branch of the same name.