Git error while pushing | Selenium Forum
A
Ashish Posted on 19/12/2019

Getting below error while pushing the file:

 

C:\Ashish\Selenium-2>git push origin master
To https://github.com/ashishgovil19/newStartSelenium.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/ashishgovil19/newStartSelenium.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

 

I tried git pull or fetch but still same... using --force i am able to but i dont want to use (force cmnd as it will erase oldd data).. Please suggest. 


A
Ashish Thakur Replied on 22/12/2019

This occours when you push to remote repository but has created a new file on remote and that file has not been pulled yet.

So take pull from remote first

git pull
and then fire
git push origin master