![원격 소스에서 Git 끌어오기 및 병합 문제](https://linux55.com/image/102876/%EC%9B%90%EA%B2%A9%20%EC%86%8C%EC%8A%A4%EC%97%90%EC%84%9C%20Git%20%EB%81%8C%EC%96%B4%EC%98%A4%EA%B8%B0%20%EB%B0%8F%20%EB%B3%91%ED%95%A9%20%EB%AC%B8%EC%A0%9C.png)
해봤 git fetch
지만 git fetch --all
같은 결과가 나오지 않았습니다. 그 후 다시 git pull을 수행하면 다음 오류가 다시 발생합니다.
원격에서 로컬로 원점을 가져오고 싶습니다.
아래에서도 이 작업을 수행했지만 여전히 오류가 발생합니다.
[root@connect /myurl/fd-ansible]# git fetch origin master
Password:
From https://github.com/myurl/fd-ansible
* branch master -> FETCH_HEAD
[root@connect /myurl/fd-ansible]# git clean -df
[root@connect /myurl/fd-ansible]# git pull
Password:
Updating 8bf6b66..a0b2167
error: Your local changes to 'group_vars/system1' would be overwritten by merge. Aborting.
Please, commit your changes or stash them before you can merge.
@Stephen Kitt 솔루션을 사용하여 편집
[root@connect /myurl/fd-ansible]# git checkout group_vars/system1
[root@connect /myurl/fd-ansible]# git pull
Password:
Updating 8bf6b66..a0b2167
Fast-forward
cmdb/vm.csv | 118 +++++++++++++++++++++++++-------------------------
group_vars/system1 | 56 ++++++++++++++++++++++++
2 files changed, 115 insertions(+), 59 deletions(-)
답변1
로컬 파일 덮어쓰기(변경 사항 손실):
git checkout group_vars/system1
그렇다면 당신은 할 수 있어야합니다 git pull
.