git --version
-
Go to the fold of the project.
-
Run
git init
Cloning is the process of pulling down a copy of a repository stored on a server.
-
Go to the parent folder of where you want to repository's folder to be in.
-
git clone [url to repository's git file] [name of folder / repository you want]
git status
git add readme.md
git commit --m "First commit"
git add chapter2/
git add -A
git branch
git branch new_model
git checkout new_model
git checkout -b new_ux
-
Switch to the branch you want to pull changes into:
git checkout master
-
Pull changes from another branch into your branch:
git merge new_ux
-
Go to GitHub.com and create a new repository.
-
Set that repository's url as the origin repo:
git remote add origin https://github.com/chrisalbon/git_tutorial.git
The -u
sets the origin as the default for this branch
git push -u origin master
git pull origin master
git fetch origin
git branch --remote
git log
git diff
git reset filename
git reset --soft HEAD^
git reset --hard HEAD^
git clone url
git show --pretty="format:" <commitID>
git revert <commitID>