Need to use version control in one of the old project which resides in Amazon EC2 instance. Steps performed:
/www/box/
Installed GIT on the server and initialised the folder /box/
git init
Cloned the project in local computer
Changed a file and tried to push but received error
git push origin master Error: Updating the current branch in a non bare repository is denied
Then created another repo folder on server and used --bare tag to initialize
/www/repos/ git init --bare
PUSH command works well on this repository
Then added another REMOTE URL to the old project location git remote add production ssh:---/www/box/
Questions:
git push gives me the same error when pushing on to the production repo. How do I push to this production repo?
git push production master Error: .... non bare repository is denied
In order to push to a remote repository you need two things:
1) The remote repository should be init with the --bare
2) You need to add the remote repository to your local git with "git add remote"
You don't need hooks for a normal push operation.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.