Installation
windows users
https://git-scm.com/download/win
mac users
download the installer https://sourceforge.net/projects/git-osx-installer/
or install homebrew and run:
brew install git
Is git installed already?
git -v
Start Using Git
Config name and email
git config --global user.name 'Nisim Cohen'
git config --global user.email 'nisim@gmail.com'
there are two options:
- initialize
- clone
initialize
git init
clone
git clone remote_repo_url
check your repo’s status
git status
simple work flow
First commit
-
create file index.html in the git repo.
-
run
git add index.html
-
run
git commit -m "my first commit"
Second commit
-
create file style.css in the git repo.
-
run
git add style.css
-
run
git commit -m "styling my website"
Third commit
-
add to index.html
<h1>avi biter</h1>
-
run
git add index.html
-
run
git commit -m "avi biter heading"
Fourth commit
-
add to index.html
<h2>Shimi Tavori</h2>
-
add to style.css
h1, h2 { text-align: center }
-
run
git add index.html style.css
-
run
git commit -m "shimi and center headings"