T
T
TechNOIR2020-11-10 10:20:09
git
TechNOIR, 2020-11-10 10:20:09

Git. What is the correct way to get changes from the master repository and apply them to the local one?

Good afternoon.

I once cloned a repository for myself, made a lot of changes that I needed. But a lot of new features have already appeared on the remote repository. How can I get these changes from a remote repository without destroying everything that I did locally?
thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gip, 2020-11-10
@Giperoglif

first commit everything that is done locally, then git pull and manually merge conflicts

A
Alexey P, 2020-11-10
@ruddy22

There are several options:
1. the most innocuous: checkout your changes to a separate branch using git checkout -b , then switch to the master/main branch and do a git pull, then merge conflicts
2. use git fetch, check out the changes from the repository, then merge conflicts
3. there is also an option to "pocket" your changes via git stash, then git pull, then git stash apply, but you have to merge conflicts.
The choice is yours

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question