I have a server on which I have a bare repository for pushing. However, my server needs to have a working copy of the master branch.
How do I get a working copy and
This is a riff off the other 2 answers but it fills the gap for my use case -- it works for updating the repo from the origin and checking out branches and any git operation because you end up with a normal complete git repo.
git clone /path/to/bare/repo /new/path/to/full/repo
cd /new/path/to/full/repo
git remote set-url origin git@github.com:swift/swift.git
After executing these 3 lines of code you can then git pull and git branch and git checkout some_branch and so on because you now have a normal complete git repo connected to your remote repo.