I would like to start using DVCS with Git for a project on my local PC. It's a private project and is to allow me to keep track of changes and versions, and in the future allow outside developers to contribute to the project. For now though I'd like to just stick with a local setup. I'm using SmartGit as my git client.
This has been my setup process:
I'd like this to be my central repository, for files to be pushed to, which will be backed up.
Now to create my working repository:
My new repo is now created.
Now testing a change to push to the central repo:
Error:
Error not all refs have been pushed -> 'master' rejected (non-fast-forward)
Following my research I try this:
Now to retry:
Again:
Error not all refs have been pushed -> 'master' rejected (non-fast-forward)
I now try to fix the error:
Message:
"Already up-to-date"
Again:
"Already up-to-date"
I then try and pull from the central repo:
Still same error when I now try and push the changes.
I'm struggling to find out how to push to my central repo.
Thanks in advance!
My suspect is that your local master
might not be tracking origin/master
. Also, your central repository should be bare, hence I'd recommend to start over again:
With SmartGit:
Create a clone from your central repository, using Clone. This will issue a warning like warning: You appear to have cloned an empty repository.
Move your existing sources/whatever into the clone and Commit. This will automatically put you onto master
.
Finally, invoke Push and confirm to Configure tracking between master
and origin/master
.