]> TLD Linux GIT Repositories - TLD.git/blobdiff - git-howto.txt
- is my name utf8 now?
[TLD.git] / git-howto.txt
index 7fe70f15f6475f58721aee4fea9be8cff4f64358..ca23bbf63e7217fcb484b28c5d7d0bb485aaf4e1 100644 (file)
-This How-To is about the Git repository in Titanium Linux.
-You will find here useful examples on how to use git in TLD.
-Ready? Let's start.
+This little howto is about the Git repository used by Titanium Linux.
+You will find here examples of the most common git commands.
 
-You need to be a developer to do some of these things.
+Ready? Let's start (you must have RW access to TLD git repositories).
 
-I. How do I commit a new .spec file or package to the repository?
+Table Of Content:
 
-1) Clone an empty repository
+1. 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
+   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
+   do not reappear.
+5. How can I add a description to a new repository?
+
+==============================================================================
+1. 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.)
 
 git clone git@git.tld-linux.org:packages/your_new_package
 
-2) Set your local Email address
+b) Set your local Email address
 
-cd your_new_repo
+cd your_new_package
 git config --local user.email your_git_login@tld-linux.org
 
-This step allows you to later push your changes to the server. If you skip this step, your push will fail due to a server-side-hook.
+This step allows you to later push your changes to the server. If you skip
+this step, your push will fail due to a server side hook.
 
-3) Put your files into the repository and locally add them
+c) Put your files into the repository and add them locally
 
-<put your files in here>
 git add file1 file2 files*
 git commit
 
-4) Push your changes to the server
+d) Push your changes to the server
+
+If you push your changes for the first time of the repositorys "life", you'll
+need to add the origin to it.
 
 git push origin master
 
-If you push your changes for the first time of the repositorys "life", you'll need to add the origin to it.
-After that you'll be fine doing just:
+After that you'll be fine by doing just:
 
 git push
 
 NOTE:
-It is possible to shorten these commands ex. git add and git commit can be put together into: git commit -a.
-You can commit several time into you local repository before pushing. You don't need to push each time you commit.
 
-II. Crap, I've checked out a repository, forgot to change the local Email address and commited my changes. Now I can't push them to the server. What can I do?
+It is possible to shorten these commands ex. git add and git commit can be put
+together into: git commit -a. You can commit several times into your local
+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
+address and commited my changes. Now I can't push them to the server.
+What can I do?
 
-This is very unfortunate. Afaik you've got only 2 options.
+This is very unfortunate. AFAIK you've got only 2 options.
+
+a) Delete your commit. This means all of your changes will be lost, but you
+can store them elsewhere for the time being, right?
 
-1) Delete your commit. This means all of your changes will be lost, but you can store them elsewhere for the time being, right?
 To do this (after you backed up your changes) type:
 
 git reset --hard HEAD~1
 
-the HEAD~1 option tells git to go 1 commit back in the history. Now set your local Email address, put back your changes and commit again. Push should now work as expected.
+the HEAD~1 option tells git to go 1 commit back in the history. Now set your
+local e-mail address, put back your changes and commit again. Push should now
+work as expected.
+
+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.
+
+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
+fails, ask one of the git admins to run and/or fix this script:
+
+~git/scripts/packages_enable_gitweb.sh
+
+Top level repositores have to be added manually to gitweb. Ask one of the git
+admins to do the following:
+
+ssh your_login@kraz.tld-linux.org
+sudo su - git
+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
+do not reappear.
+
+Please do the following in your cloned repo to restore deleted files:
+
+git checkout some.file
+
+To restore all your deleted files do:
 
-2) The second way is to remove locally your repository and re-clone it. Then put back your changes to it, commit and push.
+git ls-files -d | xargs git checkout --
 
-III. My new repository didn't show up on the web.
+==============================================================================
+5. How can I add a description to a new repository?
 
-THIS IS FOR git-admins ONLY
+Do the following:
 
-ssh your_git_login@kraz.tld-linux.org
-sudo su -
-su - git
-./scripts/packages_enable_gitweb.sh
+ssh git@git.tld-linux.org setdesc packages/some_package "Some description"
 
-That's it. Maybe this will get automated some time.