Open LivingProgram opened 8 years ago
Benefits include:
- Easily copying many files from one place to another
- Working offline! :smiley:
git bash
then open
cd
in the command line (to put you in the home directory)
git clone https://github.com/bigdata-mindstorms/jekyll-playground.git
cd jekyll-playground/
You should end up with something like the above, and you will now have changed from your home directory, to the jekyll-playground! Congrats, you just cloned a local repo! :+1: :smile:
For full explanations with screen shots, look here
- Ignore
$
- name of destination folder = DestinationFolder
- name of file = FileName
- name of folder = FolderName
Clear bash window:
$ clear
See list of folders/files within directory:
$ ls
Navigate
$ cd DestinationFolder
Go up a folder:
$ cd ..
Create folder:
$ mkdir FolderName
Remove folder:
$ rmdir FolderName
Create file:
$ touch FileName
Create file:
$ echo New line of text in the new file >> FileName
Add line of text to file:
$ echo Add this line of text to end of file >> FileName
Replace text in file:
$ echo Replace everything in file with this line > FileName
Remove file:
$ rm FileName
Remove folder and all contents:
$ rm -rf FolderName
Remove folder and all contents, also output what has been done:
$ rm -rfv FolderName
Using the built in editor vim to edit git files
A text editor that is extremely efficient for you to edit files
- Open git bash
- Type:
$ vimtutor
- Zoom in on the screen, until lesson fills the screen
- Follow instructions to learn Vim!
$ vi FileName
Cheat sheet for the controls in the Vim text editor (for full array of commands look at the
vimtutor
Move up:
j
Move down:
k
Move left:
h
Move right:
l
Exit editor (without saving):
:q!
Exit editor (with saving):
:wq
Delete character:
x
Insert text:
i
Append text (to end of line):
a
Highlight text:
v
Copy text:
y
Paste text:
p
Delete word (insert number, x, before w, to delete x amount of words):
dw
Delete line (insert number, x, before w, to delete x amount of words):
dd
Delete to end of line (insert number, x, before w, to delete x amount of words):
d$
Delete to end of word (insert number, x, before w, to delete x amount of words):
de
Undo last command:
u
Undo whole line
U
Undo the undo (pressing CTRL key, then R):
CTRL-r
Find matching ),], or }:
%
Search for phrase (your phrase = Phrase):
/Phrase
Learn markdown here
Getting Started With Git Bash
Assuming you have already downloaded git bash and set up jekyll here
Let's go!
git bash
then opencd
in the command line (to put you in the home directory)Setting up Username
git config --global user.name "YourUsername"
while substituting YourUsername with your usernameSetting up User Email
git config --global user.email YourEmail@example.com
while substituting YourEmail with your emailYou have now setup Git Bash! :+1: