How to resolve this git error

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:

  1. git fetch to update the status of the remote branch without automatic merge

  2. git push -f or git push --force to 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.

Need Your Help

Check if two 2D arrays are equal

c++ arrays equality

How can I tell if two 2D arrays exactly match every element? They have equal dimensions.

Blank parargraph HTML elements not shown

javascript html css

Is there a way to get the browser to show a paragraph element even if it is empty?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.