Reputation: 58903
I worked locally on a git repository. It has various branches like a dev branch, some branch for experimental changes and so on. And of course a master branch.
I want to setup a public (well, indeed it's a LAN thing, better say "shared") repository to only contain the master branch.
How to export that branch so that I can copy it to the destination folder?
Upvotes: 2
Views: 5478
Reputation: 69535
As the git-push manual says:
git push origin HEAD:master
Push the current branch to the remote ref matching master in the origin repository. This form is convenient to push the current branch without thinking about its local name.
or
git push origin HEAD
A handy way to push the current branch to the same name on the remote.
Using these commands you do:
git init --bare
repository at some "shared location"git remote add origin
this location to your current working repositorygit push --force origin HEAD
from your master branchUpvotes: 2
Reputation: 143229
I'd consider setting up separate public repository with "alternates" pointing to the one you're working on and push your branch to it. Or maybe symlink the master branch to the one in your local repository. I haven't tried that, but it should work.
Upvotes: 0