Skip to content

Instantly share code, notes, and snippets.

@husmen
Last active June 25, 2018 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save husmen/e33aeab89f6310dc929db5ed016943bc to your computer and use it in GitHub Desktop.
Save husmen/e33aeab89f6310dc929db5ed016943bc to your computer and use it in GitHub Desktop.
GitHub getting started

Resources

brief

detailed | git-scm getting started

detailed | github help

Türkçe

Installing git

sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
sudo apt-get install git
apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev

Check installation

git --version

First-Time Git Setup

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git config --list

Basic operations

start git in your project folder

git init

check remotes

git remote -v

add remote project to local git

git remote add origin https://github.com/you/project

clone a folder online

git clone https://github.com/husmen/FourPlusOne.git

check status

git status

add files

git add .
git add test.py

commit changes

git commit -m .

synchronize changes

git pull
git pull origin master
git push
git push origin master

Other operations

ignore files

cat .gitignore

review history

git log
git diff
git show

cancel last commit

git commit --amend
git reset [commit]
git reset --hard [commit]

manipulating files

git rm grit.gemspec
git mv file_from file_to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment