It's been 3 days since I made the original app. I intended to define the requirements firmly, but it came out like this, "Oh, I have to do this too" "That? Misspelling" "What? What should I do here?" A series of such things. I was doing the work branch thinking that I had to commit diligently, and then I went back to another branch, and I couldn't understand why. ** "Delete the branch that has been merged once!" ** It seems that it was the beginning of hell that came up with that ...
% git branch -D master
"I did it while looking at the article. I don't know why this happened. I regret it." (Audio is processed to protect privacy
The master branch disappears. It's scary. After that, extract reflog with the following command
% git reflog
⬇️⬇️⬇️ Results below ⬇️⬇️⬇️
0422208 (HEAD -> master) HEAD@{0}: checkout:moving from user management function to master
444f2b7 (origin/User management function, User management function) HEAD@{1}: checkout: moving from master to User management function
0422208 (HEAD -> master) HEAD@{2}: checkout:moving from user management function to master
444f2b7 (origin/User management function, User management function) HEAD@{3}: checkout: moving from master to User management function
0422208 (HEAD -> master) HEAD@{4}: checkout:moving from user management function to master
444f2b7 (origin/User management function, User management function) HEAD@{5}: checkout: moving from master to User management function
0422208 (HEAD -> master) HEAD@{6}: checkout:moving from user management function to master
~ The following is omitted ~
Check the display of HEAD that came out and enter the corresponding number
% git branch master HEAD@{21}
Zaoriku success. You did it!
Newer Commmits on Remote
It's already committed! Was angry. Where? It's not reflected ... When I check it, it looks like this.
% git branch -a
* master
Create new table
User management function
remotes/origin/master
remotes/origin/Create new table
remotes/origin/User management function
There are remotes! I don't know why it isn't reflected. I'm addicted to it for about 2 hours. Did the resurrection spell go wrong? Was that Zaoral, not Zaoriku? Thinking about that, I read the English article that came out after searching for an error sentence because it just didn't work.
Apparently it's an error that comes from not having a tracking branch set in the master branch of the local repository (I'm not sure what you're saying) It will be recovered by cloning the repository.
The feeling is that I deleted it so the master branch wasn't back in perfect condition! What do you mean? I will try it for the time being.
% git branch -u origin/master
Now you can pull nicely! I was relieved ... I've searched a lot, but I don't understand what the "-u" command means. What is the command doing? remotes/origin/master I thought it was a remote branch, but it's different. I've read it several times but it's really difficult. There are still many things I don't understand. It's rewarding.
https://qiita.com/forest1/items/db5ac003d310449743ca
Thank you very much.
Recommended Posts