N
N
Nikita Shchypylov2017-08-17 22:10:47
git
Nikita Shchypylov, 2017-08-17 22:10:47

How to properly pull and merge changes in a branch?

We both work in the master.
I made changes locally and want to push them to master, but my partner's commit is there. How not to rub it?
I get to do:

git stash
git pull
git stash pop
git add .
git commit
git push

Is everything right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2017-08-17
@POS_troi

We both work in the master.

stop doing that
stop doing that
No, that's not right, stop
doing
that

X
Xeli, 2017-08-17
@Xeli

How not to rub it?

git won't let you overwrite it. It will offer to download the forward branch, then merge, and then it will be possible to push the patch to the server.
In any case, it will be possible to roll back to your partner's commit without any headache. You can work in the master, no matter what they say here, it's just not convenient. Git supports the philosophy of working with branches. Those. for each subtask, a branch is created, which is then merged or rebased to the master.
And most importantly, never rebase commits that you don't have locally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question