3 ms·
I hear all that, but --bare is necessary in this case because git (by default) won't let you push to a non-bare filesystem branch: ~/temp/a:master $ git p
by josephg 4y ago
I hear all that, but --bare is necessary in this case because git (by default) won't let you push to a non-bare filesystem branch:
~/temp/a:master $ git push backup
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 212 bytes | 212.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
...
To ../b
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to '../b'
- westurner 4y agogit clone --mirror git clone --bare git push --mirror git push --all "Is `git push --mirror` sufficient for backing up my repository?" https://stackoverflow.com/questions/3333102/is-git-push-mirror-sufficient-for-backing-up-my-repository/3341392#3341392 https://stackoverflow.com/questions/3333102/is-git-push-mirr... : > So it's usually best to use --mirror for one time copies, and just use normal push (maybe with --all) for normal uses. git push: https://git-scm.com/docs/git-push https://git-scm.com/docs/git-push git clone: https://git-scm.com/docs/git-clone https://git-scm.com/docs/git-clone