Ooops! Please forgive the error. I mixed apples and oranges (two different projects). Thanks for the answers. They’re not wasted.
My whole purpose in asking this question is I am trying to take a development directory and transfer it out to a server, from which I will then update in the future using git commit.
I got a great solution from this question specifically Josh Lindsey’s answer. It worked fine for one project I have, but for another I got some errors, and want to know the best way to fix them.
I did follow the instructions for initializing the remote directory.
When I issue the git push origin master command from the local directory, I get these errors.
amr@h2oamr:~/bin$ git push origin master
cvsuser@h2oamr's password:
To cvsuser@h2oamr:/home/cvsuser/master_source_repository_git/ics/addr_verify_clj.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'cvsuser@h2oamr:/home/cvsuser/master_source_repository_git/ics/addr_verify_clj.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Depending on what you really want to do, you have two other options apart from what has already been suggested:
git fetchto update the status of the remote branch without automatic mergegit push -forgit push --forceto push your local branch onto the remote branch and overwrite its existing head regardless of the consequences (even if your local branch is outdated as compared to it)Usually I will do 1 before deciding whether to do 2.