Skip to content
This repository has been archived by the owner on Aug 22, 2020. It is now read-only.

GitHub Resources for Crises #92

Open
ebeshero opened this issue Dec 11, 2015 · 7 comments
Open

GitHub Resources for Crises #92

ebeshero opened this issue Dec 11, 2015 · 7 comments

Comments

@ebeshero
Copy link
Owner

ebeshero commented Dec 11, 2015

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
Copy link
Owner Author

ebeshero commented Jan 7, 2016

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

@RJP43
Copy link
Collaborator

RJP43 commented Jan 8, 2016

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

@ebeshero
Copy link
Owner Author

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 ebeshero changed the title GitHub Resources GitHub Resources for Crises Sep 25, 2016
@RJP43 RJP43 added this to the Using Git milestone Dec 30, 2016
@ebeshero
Copy link
Owner Author

ebeshero commented Jan 9, 2017

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
Copy link
Owner Author

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
Copy link
Owner Author

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
Copy link
Owner Author

ebeshero commented Apr 8, 2017

@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.

Repository owner deleted a comment from RJP43 Sep 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants