I would like to perform violence upon code branching and merging
seen from China
seen from Malaysia
seen from Philippines
seen from Albania
seen from Germany
seen from Canada

seen from Malaysia

seen from Australia

seen from Netherlands
seen from Netherlands
seen from China

seen from Australia
seen from United States

seen from Malaysia
seen from Russia

seen from Brazil

seen from Canada

seen from Netherlands
seen from United States
seen from United States
I would like to perform violence upon code branching and merging
How to save a fucked up git repo
Mistake:
You have an existing repo that is 3 hours worth of changes different from the remote. They aren’t linked, but you want them to be linked, so you “git remote add origin [git repo url]” the thing. Then, you do the dumbest thing you could possibly think of:
You pull.
And then you get 100000000000000 merge conflicts and ALL YOUR FILES ARE FUCKED UP.
How to save? Well, if you are like me, and somehow was smart enough to have a local git log on the existing repo with 3 hours worth of changes, then you will then “git reset HEAD@{1}” and then panic because you don’t know what “Unstaged changes after reset:” and all your files are the old versions that existed before the 3 hours worth of changes (sry I’m big dumbass and didn’t do more git commits...).
Then you do some googling and realize you just gotta check out the files that need to be staged aka the files that were added/committed at the correct commit you just reset to. Then everything works again, and then to update the remote, you do:
“git push origin master --force”
And yay.
Easy and Quick Fix for Github Merge Conflicts
1. Switch to your local master branch.
2. Pull down all of the new changes.
3. Switch back to the branch that you'd like to merge.
4. git rebase master to pull in all of your new changes
5. git status: this will show you the file that needs to be fixed
6. Open up the file that needs to be fixed. The section you are working in is divided into 2 sections by the head and two bars. What is under "Head" is the new changes that you pulled into master. It should look something like this:
https://gist.github.com/LNA/1cfcdd954b5051dff147
7. Delete the code that you don't want, the conflict bars, the "Head" line, and the line with the commit message.
8. git add . to add the updated file
9. git rebase --continue
10. git push --force from your local branch to your branch on github. NEVER FORCE PUSH TO MASTER. YES I'M YELLING.
Celebrate that fact that you didn't beak anything!!!