L
L
Li2020-06-12 21:01:50
git
Li, 2020-06-12 21:01:50

How to perform a correct git pull?

When I run git pull on the hosting, I get the following:

Updating bad8093..852d6b7
error: Your local changes to the following files would be overwritten by merge:
- public/images/achievements/2.png
- public/images/achievements/23.png
- public/images/achievements/3.png
Please, commit your changes or stash them before you can merge.

public/images/achievements/ - user folder which is not in the repository

git status gives
Changes not staged for commit:
# (use "git add ..." to update what will be committed)
# (use "git checkout -- ..." to discard changes in working directory)
# modified: config/db.php
# modified: config/vk_auth.php
# modified: public/images/achievements/2.png
# modified: public/images/achievements/23.png
# modified: public/images/achievements/3.png

.gitignore contains the lines:
/public/images/*
/config/ db.php
/config/vk_auth.php

Actually the question is:
1. How to make changes correctly so that git pull will work ..
Updates need to be made only on the hosting.

2. Sometimes you have to urgently make adjustments right in production, in which case conflicts arise again. What is the algorithm of actions in this case.

Thanks for the replies

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2020-06-12
@cubaPro

You have local changes that conflict with remote ones. You need to either commit them (then with git pull you will need to resolve the conflict), or remove them altogether, for example, zip them.
git pull works correctly, no need to force it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question