S
S
SergT2017-07-10 14:39:36
git
SergT, 2017-07-10 14:39:36

Can git push ignore errors?

Recently I just started learning Git and "version control" in general.
I develop and maintain a website. Previously, it was enough for me to develop all the time on a working server, but I decided to increase my knowledge and not touch the production server.
The repository has only two branches master and feature. On a working computer, I calmly developed new changes in the feature branch, after debugging I did a merge in master and pull on the production server, if anything was updated on the production server, then I did a push and everything went normally, everyday ... simple operations.
But a couple of days ago, the pradakshn server was completely reinstalled. The site was copied (backed up) along with the .git folder, after which the content management system core was updated, which required a push from the production server to the repository.
But then an error appeared:

! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:ххх/ххх.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

In the content management system core, many files have been changed, removed and added.
If I do pull origin master, then I'm afraid I'll have to clean up the core of the site management system from garbage for a long time.
How can I push to the repository so that all changes are written ignoring various warnings? Or how to proceed so that what is now on the production server remains?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Moseychuk, 2017-07-10
@SergT

git push --force
This will overwrite changes on the server with local changes.

D
Denis Zagaevsky, 2017-07-10
@zagayevskiy

--force, but you won't roll it back later.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question