T
T
to_east2018-05-14 05:56:34
git
to_east, 2018-05-14 05:56:34

Github some questions about working with branches?

Greetings Toaster Members!
It's easier to show my problem in the pictures:
1) I make two subsequent commits in the master branch:
5af8f84716bdb197675504.jpeg
2) Then I create the foo branch, switch to it, make a commit:
5af8f8c93d28d050523170.jpeg
3) I make another commit in the foo branch:
5af8f8e97df43253467903.jpeg
Then I need to make changes that don’t fit in any way , for aesthetic reasons, in the foo branch, and you need to commit them in the master branch.
4) I switch to the master branch and make a commit:
5af8f9b4d7d1c531020713.jpeg
And here is the question itself: is the course of my thoughts on the previous screen correct, should the tree be like this?
If so, then I need the latest changes made to the foo branch too.
Simply put, you need to shift the origin of the foo branch to the 5th commit of the master branch, like this:
5af8fab23de06300639734.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2018-05-14
@to_east

And here is the question itself: on the previous screen, is the course of my thoughts correct, should the tree be like this?

Yes.
git rebase master foo

A
aol-nnov, 2018-05-14
@aol-nnov

hello graffiti artists!
instead of smearing paper, scanning and attaching to the question, you could simply refer to the documentation: https://git-scm.com/book/en/v2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question