From: Marcin Krol Date: Sun, 18 Sep 2011 20:53:25 +0000 (+0200) Subject: - moved from how-tos.git X-Git-Url: https://git.tld-linux.org/?p=TLD.git;a=commitdiff_plain;h=311845f8939a103495be84f979ba095e2a33ab3c - moved from how-tos.git --- diff --git a/git-howto.txt b/git-howto.txt new file mode 100644 index 0000000..7fe70f1 --- /dev/null +++ b/git-howto.txt @@ -0,0 +1,61 @@ +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. + +You need to be a developer to do some of these things. + +I. How do I commit a new .spec file or package to the repository? + +1) Clone an empty repository + +git clone git@git.tld-linux.org:packages/your_new_package + +2) Set your local Email address + +cd your_new_repo +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. + +3) Put your files into the repository and locally add them + + +git add file1 file2 files* +git commit + +4) Push your changes to the server + +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: + +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? + +This is very unfortunate. Afaik you've got only 2 options. + +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. + +2) The second way is to remove locally your repository and re-clone it. Then put back your changes to it, commit and push. + +III. My new repository didn't show up on the web. + +THIS IS FOR git-admins ONLY + +ssh your_git_login@kraz.tld-linux.org +sudo su - +su - git +./scripts/packages_enable_gitweb.sh + +That's it. Maybe this will get automated some time.