What will git verification wizard + git reset do?

I am relatively new to git and with some problems early on. I made several commits, but when I try to push them through, I get a response saying that everything is updated. I feel that my problem is the same as indicated in this question , but she recommends the following:

$ git log -1
# note the SHA-1 of latest commit
$ git checkout master
# reset your branch head to your previously detached commit
$ git reset --hard <commit-id>

What exactly will the “master check” be? I just don't want to lose the changes I made ...

Screenshot from gitk:
enter image description here

+3
source share
2 answers

Branch checking moves the local pointer HEADso that it points to the same commit as the branch reference. For instance:

mybranch (C ):

                        HEAD
                        |
                        V
            master      mybranch
            |           |
            V           V
C1 -------> C2 -------> C3

git checkout master:

            HEAD
            |
            V
            master      mybranch
            |           |
            V           V
C1 -------> C2 -------> C3

, , . , , .

" ", , , C3 . , , master, (C3). master git, , reset SHA1 , master, .

Edit:

. , - git. Committing , Subversion. git add filename , filename - . , git commit.

- git commit -a, . git add. : git commit -a . , , git add.

, git push, . . Subversion, , - .

+4

git checkout master , master, .

-1

Source: https://habr.com/ru/post/1736410/


All Articles