Skip to content

Instantly share code, notes, and snippets.

@hasantktl
Forked from vigo/git-tips-00-main.md
Created November 10, 2013 13:20
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 hasantktl/7398175 to your computer and use it in GitHub Desktop.
Save hasantktl/7398175 to your computer and use it in GitHub Desktop.

Git Tips

Config: Basic / Default

git config --global user.name "Your Name"
git config --global user.email "Your Email"
git config --global color.ui true
git config --global apply.whitespace nowarn

Github: Repo oluşturmak

  • Önce github'da repo oluştur
  • Daha sonra ilgili git url'ini al. git@github.com:vigo/Sample_Project.git
mkdir my_local_branch
cd my_local_branch/
git init
touch readme.md
git add readme.md
git commit -m "init"
git remote add origin git@github.com:vigo/Sample_Project.git
git push origin master

Eğer daha önceden local'de bulunan bir repoyu daha sonra github'a taşımak istersen:

cd existing_git_repo/
git remote add origin git@github.com:vigo/Sample_Project.git
git push origin master

Git === SVN

git clone URL             # svn co URL
git pull                  # svn update
git init                  # svnadmin create repo
git add .                 # svn import file://repo
git commit -a             # svn ci -m "MESSAGE"
git diff                  # svn diff
git status                # svn status
git add FILE              # svn add FILE
git rm FILE               # svn rm FILE
git mv FILE               # svn mv FILE
git tag -a name           # svn copy URL1 URL2
git tag -l                # svn list URL
git show tag              # svn log --limit 1 URL
git branch BRANCH         # svn cp URL1/trunk URL2/svn/branches/BRANCH
git checkout BRANCH       # svn switch URL/svn/branches/BRANCH
git branch                # svn list URL/svn/branches
git checkout REV          # svn update -r REV
git merge BRANCH          # svn merge -r REV:HEAD URL/svn/branches/BRANCH
git cherry-pick           # svn merge -c rev url
git remote -v             # svn info

Kontrol

git remote -v                 # fetch ve push url'lerini gör
git remote show origin        # detaylı bilgi al

Reset

Branch

Tag

Submodules

Log

Hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment