DHClass-Hub icon indicating copy to clipboard operation
DHClass-Hub copied to clipboard

GitHub Resources for Crises

Open ebeshero opened this issue 10 years ago • 7 comments

I'm adding some GitHub resources to help quickly in case of crises. Please add to this as you find helpful resources!

Guidance for merge-conflicts: https://help.github.com/articles/resolving-a-merge-conflict-from-the-command-line/

ebeshero avatar Dec 11 '15 14:12 ebeshero

Reverting, Rewinding and Rebasing: https://github.com/blog/2019-how-to-undo-almost-anything-with-git

ebeshero avatar Jan 07 '16 22:01 ebeshero

Here are some more basic shell commands: https://www.siteground.com/tutorials/git/commands.htm

RJP43 avatar Jan 08 '16 04:01 RJP43

I needed to restore a directory I deleted months ago, and this site walked me through it: http://gitready.com/intermediate/2009/03/18/restoring-a-directory-from-history.html

ebeshero avatar Sep 14 '16 05:09 ebeshero

When resolving a merge issue or a merge conflict, the Terminal or Git bash shell brings up a text editor named vim, and asks you to write a commit message in it. To complete the message, you need to type 'I', and type a commit message (no quotation marks needed). Then, to exit vim, you need to enter the following sequence:

ESC 
:wq

or try

ESC
and hold down
SHIFT + zz

See http://unix.stackexchange.com/questions/181280/how-to-exit-a-git-merge-asking-for-commit-message

ebeshero avatar Jan 09 '17 05:01 ebeshero

Here's more on the weird little "vim" editor that pops up in Git Bash (windows) or Terminal (mac) sometimes when you're resolving a merge conflict. It's an old text editor that runs entirely from your keyboard (no mouse), and if you want to learn (as I do) how to use it effectively, here's a very helpful post on how to use it right: https://www.linux.com/learn/vim-101-beginners-guide-vim

ebeshero avatar Jan 15 '17 13:01 ebeshero

A "merge tool" is software you can open from command line to help resolve a merge conflict when you need to hand-correct the files. We could really open those files in any text or code editor (including oXygen), but some software like Meld helps because it highlights differences and can make it visually easier to choose the alternates. To really understand what happens when Git does a merge, and to take the most advantage of Meld, I recommend taking a look at this article: http://blog.wuwon.id.au/2010/09/painless-merge-conflict-resolution-in.html

ebeshero avatar Jan 15 '17 14:01 ebeshero

@RJP43 @ajnewton1 @jonhoranic @bsf15 @ahunker @Samantha-Mcguigan Let's say you've just done something magnificently stupid in your project files (as I just did), and you really want to just completely undo it without committing it the GitHub repo. You just want to return things to EXACTLY the way they were before you did the magnificently stupid thing. What you want to do is pull in the current state of your remote origin GitHub (the one in the cloud), and to do that, you would enter:

git checkout .

This uses the checkout command to make your local file directory reflect the current state of the remote origin repo. The . means basically "this" repo.

ebeshero avatar Apr 08 '17 23:04 ebeshero