RSS

Git-Reset commit in local branch

19 Mar

I have committed a file in my local master branch, I am trying to push that file to the remove master branch, I got the below mentioned error.

$ git commit -m "file committed" [File Name]
$ git pull origin master

Error:

! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to ‘git@git.company.com:projectName.git’

After that i tried to pull the content form master branch. I got conflict error.

$ git pull origin master

Error:

CONFLICT (content): Merge conflict in [Conflicted File with path]
Automatic merge failed; fix conflicts and then commit the result.

I just reset my local branch with the last committed version.

$ git reset --merge [Prior Git Versions]

Pull the content from the master branch.

$ git pull origin master

Its working fine now.

 
Leave a comment

Posted by on March 19, 2013 in Git, Repositories

 

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: