From c377cb0d326998b41ae81501283bce19fdd02ac5 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 24 Jul 2026 06:31:35 +0000 Subject: [PATCH] =?UTF-8?q?k=C4=B1lavuz:=2010-clone-and-tokens/readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 10-clone-and-tokens/readme.md | 141 ++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 10-clone-and-tokens/readme.md diff --git a/10-clone-and-tokens/readme.md b/10-clone-and-tokens/readme.md new file mode 100644 index 0000000..ada26c7 --- /dev/null +++ b/10-clone-and-tokens/readme.md @@ -0,0 +1,141 @@ +# 🇬🇧 10 — Working from your computer + +The browser is enough for documents. For real work — many files at once, or running the code — copy the repository to your machine. + +## Getting a copy + +Press the **Clone** button on the repository page and copy the address. + +```bash +git clone https://forge.kabaforce.com/owner/project.git +cd project +``` + +## The daily loop + +```bash +git pull # get what others changed +# ... edit files ... +git status # what did I change? +git add . # stage the changes +git commit -m "add setup notes" +git push # send them to KabaForge +``` + +If `git push` is rejected, somebody else pushed first: run `git pull`, resolve anything it reports, then push again. + +## Signing in from the command line + +Your KabaForce ID password does not work over HTTPS. Create a token instead: + +1. **Avatar → Settings → Applications → Generate New Token**. +2. Give it a name and only the permissions you need (`repo` is usually enough). +3. Copy it once — it is never shown again. +4. When git asks for a password, paste the token. + +Store it so you are asked only once: + +```bash +git config --global credential.helper store +``` + +## SSH instead of tokens + +1. Create a key if you do not have one: `ssh-keygen -t ed25519` +2. Copy `~/.ssh/id_ed25519.pub`. +3. **Avatar → Settings → SSH Keys → Add Key**, paste it. +4. Clone with the SSH address shown under **Clone**. + +No password prompts after that. + +## Useful extras + +| Need | Command | +|------|---------| +| See the history | `git log --oneline --graph` | +| Discard local changes to a file | `git restore file.md` | +| Switch branch | `git switch branch-name` | +| Create a branch | `git switch -c new-branch` | + +## Automation + +Repositories can also be read and written through the KabaForge API using the same token: + +```bash +curl -H "Authorization: token YOUR_TOKEN" \ + https://forge.kabaforce.com/api/v1/repos/owner/project/contents +``` + +Treat tokens like passwords: never put one in a file you commit. + +--- + +# 🇹🇷 10 — Bilgisayarınızdan çalışma + +Belgeler için tarayıcı yeterlidir. Asıl iş için — çok dosyayı birden değiştirmek ya da kodu çalıştırmak — depoyu makinenize kopyalayın. + +## Kopya alma + +Depo sayfasındaki **Klonla** düğmesine basıp adresi kopyalayın. + +```bash +git clone https://forge.kabaforce.com/sahip/proje.git +cd proje +``` + +## Günlük döngü + +```bash +git pull # başkalarının değiştirdiklerini al +# ... dosyaları düzenleyin ... +git status # ne değiştirdim? +git add . # değişiklikleri hazırla +git commit -m "kurulum notları eklendi" +git push # KabaForge'a gönder +``` + +`git push` reddedilirse başkası sizden önce göndermiştir: `git pull` çalıştırın, bildirdiği çakışmaları çözün, sonra tekrar gönderin. + +## Komut satırından kimlik doğrulama + +KabaForce ID parolanız HTTPS üzerinden çalışmaz. Bunun yerine jeton oluşturun: + +1. **Avatar → Ayarlar → Uygulamalar → Yeni Jeton Üret**. +2. Bir ad verin ve yalnız ihtiyaç duyduğunuz yetkileri seçin (genelde `repo` yeter). +3. Jetonu bir kez kopyalayın — bir daha gösterilmez. +4. Git parola sorduğunda jetonu yapıştırın. + +Bir kez sorulması için saklayın: + +```bash +git config --global credential.helper store +``` + +## Jeton yerine SSH + +1. Anahtarınız yoksa oluşturun: `ssh-keygen -t ed25519` +2. `~/.ssh/id_ed25519.pub` içeriğini kopyalayın. +3. **Avatar → Ayarlar → SSH Anahtarları → Anahtar Ekle**, yapıştırın. +4. **Klonla** altındaki SSH adresiyle klonlayın. + +Bundan sonra parola sorulmaz. + +## İşe yarayan ekler + +| İhtiyaç | Komut | +|---------|-------| +| Geçmişi görmek | `git log --oneline --graph` | +| Bir dosyadaki yerel değişiklikleri atmak | `git restore dosya.md` | +| Dal değiştirmek | `git switch dal-adi` | +| Dal oluşturmak | `git switch -c yeni-dal` | + +## Otomasyon + +Depolar aynı jetonla KabaForge API'si üzerinden de okunup yazılabilir: + +```bash +curl -H "Authorization: token JETONUNUZ" \ + https://forge.kabaforce.com/api/v1/repos/sahip/proje/contents +``` + +Jetonları parola gibi görün: işleyeceğiniz bir dosyanın içine asla koymayın.