{"id":164,"date":"2025-05-04T10:22:31","date_gmt":"2025-05-04T10:22:31","guid":{"rendered":"https:\/\/www.webmobkey.com\/blog\/?p=164"},"modified":"2025-11-16T10:27:21","modified_gmt":"2025-11-16T10:27:21","slug":"temel-git-komutlari","status":"publish","type":"post","link":"https:\/\/www.webmobdesign.com\/blog\/tr\/temel-git-komutlari\/","title":{"rendered":"Temel Git Komutlar\u0131"},"content":{"rendered":"\n<p id=\"c089\">Git, yaz\u0131l\u0131m geli\u015ftirme s\u00fcre\u00e7lerinde kodlar\u0131 y\u00f6netmek ve versiyon kontrol\u00fc yapmak i\u00e7in kullan\u0131lan g\u00fc\u00e7l\u00fc bir ara\u00e7t\u0131r. Bu yaz\u0131da, Git ile ilgili temel komutlar\u0131 ve bu komutlar\u0131n nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 \u00f6\u011frenelim.<\/p>\n\n\n\n<p id=\"4756\">#### 1. Git Kullan\u0131c\u0131 Bilgilerini Ayarlama<\/p>\n\n\n\n<p id=\"312b\">Git kullan\u0131rken, kullan\u0131c\u0131 ad\u0131 ve e-posta adresi belirtmek \u00f6nemlidir. Bu bilgiler commit\u2019lerinizde yer al\u0131r ve kim taraf\u0131ndan yap\u0131ld\u0131\u011f\u0131n\u0131 g\u00f6sterir.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit config - global user.name &quot;Ahmet Ak\u0131n&quot;\n<\/pre><\/div>\n\n\n<p id=\"a66f\">Bu komutla Git ortam\u0131nda kendinize bir kullan\u0131c\u0131 ad\u0131 belirtirsiniz.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n  git config - global user.email &quot;deneme@deneme.com&quot;\n<\/pre><\/div>\n\n\n<p id=\"5e9c\">Bu komutla Git ortam\u0131nda kendinize bir e-posta belirtirsiniz.<\/p>\n\n\n\n<p id=\"5208\">#### 2. Mevcut Dizin ve Dosyalar\u0131 G\u00f6r\u00fcnt\u00fcleme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npwd\n<\/pre><\/div>\n\n\n<p>Bu komutla bulundu\u011funuz klas\u00f6r\u00fcn dizinini g\u00f6stermi\u015f olursunuz.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\nls --dosya listeler\n<\/pre><\/div>\n\n\n<p id=\"1f98\">Bu komutla bulundu\u011funuz klas\u00f6rdeki dosyalar\u0131 liste \u015feklinde g\u00f6stermi\u015f olursunuz.<\/p>\n\n\n\n<p id=\"36f9\">#### 3. Git Projesi Ba\u015flatma<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit init\n<\/pre><\/div>\n\n\n<p>Bu komutla projemizi Git projesi haline getiriyoruz.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\nls -a\n<\/pre><\/div>\n\n\n<p id=\"3f52\">Bu komut, gizli dosyalar\u0131 (\u00f6rne\u011fin `.git` klas\u00f6r\u00fcn\u00fc) g\u00f6sterir.<\/p>\n\n\n\n<p id=\"5c13\">#### 4. Dosyalar\u0131 Ge\u00e7i\u015f B\u00f6lgesine Eklemek ve Commit Etmek<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit add .\n<\/pre><\/div>\n\n\n<p id=\"1f06\">Bu komutla t\u00fcm dosyalar\u0131n\u0131z\u0131 ge\u00e7i\u015f b\u00f6lgesine (staging area) eklemi\u015f olursunuz.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit commit -m &quot;Proje olu\u015fturuldu&quot;\n<\/pre><\/div>\n\n\n<p id=\"bce2\">Bu komutla ge\u00e7i\u015f b\u00f6lgesindeki dosyalar\u0131 Git deposuna kaydedersiniz.<\/p>\n\n\n\n<p id=\"ea44\">#### 5. Loglar\u0131 ve Durumlar\u0131 Kontrol Etme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit log\n<\/pre><\/div>\n\n\n<p>Bu komut olu\u015fturulmu\u015f Git loglar\u0131n\u0131 g\u00f6sterir.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit status\n<\/pre><\/div>\n\n\n<p>Projenizdeki de\u011fi\u015fiklikleri g\u00f6sterir. Bu komut olduk\u00e7a \u00f6nemlidir.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit diff\n<\/pre><\/div>\n\n\n<p id=\"871d\">Projenizdeki de\u011fi\u015fiklikleri sat\u0131r sat\u0131r g\u00f6sterir.<\/p>\n\n\n\n<p id=\"b2b0\">#### 6. Belirli Bir Commit\u2019e Geri D\u00f6nme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit checkout a3149b639af0230bede07106a72d182f7933940c\n<\/pre><\/div>\n\n\n<p id=\"3764\">Bu komut, belirli bir commit\u2019e geri d\u00f6nmenizi sa\u011flar. (Commit numaras\u0131: `a3149b639af0230bede07106a72d182f7933940c`)<\/p>\n\n\n\n<p id=\"1261\">#### 7. Git Loglar\u0131n\u0131 ve Ge\u00e7mi\u015fini Temizleme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n( find . -type d -name &quot;.git&quot; \\ &amp;&amp; find . -name &quot;.gitignore&quot; \\ &amp;&amp; find . -name &quot;.gitmodules&quot; ) | xargs rm -rf\n<\/pre><\/div>\n\n\n<p id=\"6052\">Bu komut, bulundu\u011funuz klas\u00f6rdeki t\u00fcm Git loglar\u0131n\u0131 ve ilgili dosyalar\u0131 siler.<\/p>\n\n\n\n<p id=\"0393\">#### 8. `.gitignore` Dosyas\u0131n\u0131 Kullanma<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntouch .gitignore\n<\/pre><\/div>\n\n\n<p id=\"6a71\">Bu komut, `.gitignore` dosyas\u0131n\u0131 olu\u015fturur. Bu dosyaya, Git\u2019in takip etmesini istemedi\u011finiz dosyalar\u0131n isimlerini yazabilirsiniz.<\/p>\n\n\n\n<p id=\"d050\">#### 9. Branch Y\u00f6netimi<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit branch\n<\/pre><\/div>\n\n\n<p>Bu komut mevcut Git branch\u2019lerini g\u00f6sterir.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit branch (branch ismi)\n<\/pre><\/div>\n\n\n<p>Bu komut yeni bir branch olu\u015fturur.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit switch master\n<\/pre><\/div>\n\n\n<p id=\"16b8\">Bu komut, aktif branch\u2019i de\u011fi\u015ftirir.<\/p>\n\n\n\n<p id=\"a5b9\">#### 10. Branch\u2019leri Birle\u015ftirme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit merge (branch ismi)\n<\/pre><\/div>\n\n\n<p id=\"a461\">Bu komut, belirtti\u011finiz branch\u2019i mevcut branch ile birle\u015ftirir.<\/p>\n\n\n\n<p id=\"9335\">#### 11. Dosya Geri Y\u00fckleme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit restore istedigimdosya.txt\n<\/pre><\/div>\n\n\n<p id=\"1cef\">Bu komut, belirtilen dosyay\u0131 geri y\u00fckler. Daha fazla bilgi i\u00e7in [bu linke](<a href=\"https:\/\/www.git-tower.com\/learn\/git\/commands\/git-restore\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/www.git-tower.com\/learn\/git\/commands\/git-restore<\/a>) g\u00f6z atabilirsiniz.<\/p>\n\n\n\n<p id=\"9c04\">#### 12. Commit\u2019i Geri Alma<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit revert (commit hash)\n<\/pre><\/div>\n\n\n<p id=\"1724\">Bu komut, belirli bir commit\u2019i geri almak i\u00e7in kullan\u0131l\u0131r.<\/p>\n\n\n\n<p id=\"cfb0\">#### 13. Ge\u00e7i\u015f B\u00f6lgesindeki Dosyay\u0131 Silme<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit rm - cached index.html\n<\/pre><\/div>\n\n\n<p id=\"0285\">Bu komut, ge\u00e7i\u015f b\u00f6lgesindeki dosyay\u0131 (staging area) siler.<\/p>\n\n\n\n<p id=\"1dd8\">#### 14. Git Reset Komutlar\u0131<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit reset - mixed HEAD~1\ngit reset - hard HEAD~1\ngit reset - soft (commit hash)\n<\/pre><\/div>\n\n\n<p id=\"73eb\">Bu komutlar, commit\u2019lerinizi geri almak i\u00e7in kullan\u0131l\u0131r. Daha fazla bilgi i\u00e7in [bu makaleye](<a href=\"https:\/\/medium.com\/@mustafazahidefe\/git-notlar%C4%B1-7-git-reset-6fefc9835cbe\">https:\/\/medium.com\/@mustafazahidefe\/git-notlar%C4%B1-7-git-reset-6fefc9835cbe<\/a>) g\u00f6z atman\u0131z\u0131 tavsiye ederim.<\/p>\n\n\n\n<p id=\"665d\">### Sonu\u00e7<\/p>\n\n\n\n<p id=\"91f5\">Bu temel Git komutlar\u0131 ile versiyon kontrol\u00fc ve kod y\u00f6netimini daha verimli bir \u015fekilde yapabilirsiniz. Daha ileri d\u00fczey komutlar ve kullan\u0131m detaylar\u0131 i\u00e7in resmi Git dok\u00fcmantasyonuna ve di\u011fer e\u011fitim materyallerine g\u00f6z atman\u0131z\u0131 \u00f6neririm.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git, yaz\u0131l\u0131m geli\u015ftirme s\u00fcre\u00e7lerinde kodlar\u0131 y\u00f6netmek ve versiyon kontrol\u00fc yapmak i\u00e7in kullan\u0131lan g\u00fc\u00e7l\u00fc bir ara\u00e7t\u0131r. Bu &hellip; <a title=\"Temel Git Komutlar\u0131\" class=\"hm-read-more\" href=\"https:\/\/www.webmobdesign.com\/blog\/tr\/temel-git-komutlari\/\"><span class=\"screen-reader-text\">Temel Git Komutlar\u0131<\/span>Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-164","post","type-post","status-publish","format-standard","hentry","category-web-tr"],"_links":{"self":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts\/164","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/comments?post=164"}],"version-history":[{"count":2,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts\/164\/revisions"}],"predecessor-version":[{"id":434,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/posts\/164\/revisions\/434"}],"wp:attachment":[{"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/media?parent=164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/categories?post=164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webmobdesign.com\/blog\/wp-json\/wp\/v2\/tags?post=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}