search

Home  >  Q&A  >  body text

git - How to update the Fork project to be consistent with the original project

I am currently operating on the branch of the forked project
I probably know the principle of updating the forked project
Set an original address and then pull the master of the original address to the local and push it to On the branch of the fork project Finally, pullRequest is mentioned for merge
But after I added the remote branch, it looked like this

Then use
pull ruexue master on the gork branch. When pulling the code, the following interface appears
and I don’t know how to change it.

And what is going on... is it a conflict

There is also a small question... How does git withdraw something that is already in the cache? For example, I git add a file and now want to withdraw it

过去多啦不再A梦过去多啦不再A梦2772 days ago740

reply all(1)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-02 09:41:21

    Same as a rookie.

    Question 1: There is a gap between the branch you forked at that time and the current source branch, so when you pull, you will naturally write a merge commit; if you have obsessive-compulsive disorder, you are not limited to seeing this, you can look at the rebase command.
    Question 2: When you were editing things in vim, you didn’t have the correct: wq or: q!
    Question 3: Isn’t there a prompt when git commits?
    Before committing:
    git add <file> //Add
    git checkout -- <file> //Discard the workspace changes
    git reset HEAD <file> Evacuate cache

    Already committed:
    Look at the git log
    Then git reset --[hard|soft] commit_id

    reply
    0
  • Cancelreply