WHAT I AM TRYING TO ACHIEVE---
I know little about git and trying to learn it. I don't have git installed in my server.
Hence I am trying to create a folder(Git Repos Folder) in my system that will act as a directory of repositories. (Like repositories created in GitHub) and another folder(Git Clones Folder) where I can clone the repos and work on them.( Like local clones of github repositories).
I want to be able to commit and push from any of the repositories in Git Clones Folder to the respective repositories in Git Repos Folder.
WHAT I HAVE TRIED -
I created a repo named praveenpuglia.com inside Git Repos Folder and ran git init
to make it a git repository.
Next I cloned the repo as praveenpuglia.com inside Git Clones Folder using git clone D:/Git Repos Folder/praveenpuglia.com
I put a readme file , staged and committed it.
When I try to push the changes to the master, I get these errors
Pushing to D:/Git Repos Folder/praveenpuglia.com
remote: error: refusing to update checked out branch: refs/heads/master[K
remote: error: By default, updating the current branch in a non-bare repository[K
remote: error: is denied, because it will make the index and work tree inconsistent[K
remote: error: with what you pushed, and will require 'git reset --hard' to match[K
remote: error: the work tree to HEAD.[K
remote: error: [K
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K
To D:/Git Repos Folder/praveenpuglia.com
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to D:/Git Repos Folder/praveenpuglia.com'
What am I doing wrong and how do I set it up? I have tried few of the available answers here but could not understand.