From: MichaƂ Lisowski Date: Wed, 5 Oct 2011 08:03:33 +0000 (+0200) Subject: - explanation how to configure git globally X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=ddcd5830fe8e2152d6a600467363dd3bcb440c0e;p=TLD.git - explanation how to configure git globally --- diff --git a/git-howto.txt b/git-howto.txt index 092b48b..767aff9 100644 --- a/git-howto.txt +++ b/git-howto.txt @@ -4,24 +4,53 @@ You will find here examples of the most common git commands. Ready? Let's start (you must have RW access to TLD git repositories). Table Of Content: - -1. How do I commit a new .spec file or package to the repository? +1. How do I prepare git to work? + a) Install git-core + b) Configure git globally +2. How do I commit a new .spec file or package to the repository? a) Clone an empty repository (note: it will be automatically created on server side.) b) Set your local Email address c) Put your files into the repository and add them locally d) Push your changes to the server -2. Crap, I've checked out a repository, forgot to change the local e-mail +3. Crap, I've checked out a repository, forgot to change the local e-mail address and commited my changes. Now I can't push them to the server. What can I do? -3. My new repository didn't show up on the web. -4. I've deleted some files in my cloned repo. I'm doing git pull, but they +4. My new repository didn't show up on the web. +5. I've deleted some files in my cloned repo. I'm doing git pull, but they do not reappear. -5. How can I add a description to a new repository? -6. SPECS: What is obsolete now that we have GIT? +6. How can I add a description to a new repository? +7. SPECS: What is obsolete now that we have GIT? + +============================================================================== +1. How do I prepare git to work? + +a) Install git-core + +Just install git-core package via poldek: + +poldek +install git-core + +b) Configure git globally + +To be able to work with git on TLD repository you will need to set up few +things in git config: + +- your e-mail address which consists of your git login and tld-linux.org domain +- your username, which should consist of your name and surename + +To do so, type: + +git config --global user.email "your_git_login@tld-linux.org" +git config --global user.name "John Doe" + +Replace "your_git_login" and "John Doe" accordingly. + +Above commands will create ~/.gitconfig file with proper settings. ============================================================================== -1. How do I commit a new .spec file or package to the repository? +2. How do I commit a new .spec file or package to the repository? a) Clone an empty repository (note: it will be automatically created on server side.) @@ -30,6 +59,8 @@ git clone git@git.tld-linux.org:packages/your_new_package b) Set your local Email address +This step is optional if your git is configured globally (see point 1 of this HOWTO). + cd your_new_package git config --local user.email your_git_login@tld-linux.org @@ -60,7 +91,7 @@ repository before pushing all changes to server. You don't need to push each time you commit, but feel free to do so if you want :-) ============================================================================== -2. Crap, I've checked out a repository, forgot to change the local e-mail +3. Crap, I've checked out a repository, forgot to change the local e-mail address and commited my changes. Now I can't push them to the server. What can I do? @@ -81,7 +112,7 @@ b) The second way is to remove locally your repository and re-clone it. Then put back your changes to it, commit and push. ============================================================================== -3. My new repository didn't show up on the web. +4. My new repository didn't show up on the web. Repository "packages" are checked every 15 minutes for new subrepositories by a cron job. If found, they're added to the web. If for some reason cron job @@ -98,7 +129,7 @@ cd ~/repositories/repo_name.git touch gitweb-export-ok ============================================================================== -4. I've deleted some files in my cloned repo. I'm doing git pull, but they +5. I've deleted some files in my cloned repo. I'm doing git pull, but they do not reappear. Please do the following in your cloned repo to restore deleted files: @@ -110,7 +141,7 @@ To restore all your deleted files do: git ls-files -d | xargs git checkout -- ============================================================================== -5. How can I add a description to a new repository? +6. How can I add a description to a new repository? Do the following: @@ -124,7 +155,7 @@ kernel-desktop, a linux version optimised for the desktop $ ============================================================================== -6. SPECS: What is obsolete now that we have GIT? +7. SPECS: What is obsolete now that we have GIT? Now that we use GIT for our own .spec files and projects, there're some things we do no longer need.