]> TLD Linux GIT Repositories - TLD.git/blob - git-howto.txt
7fe70f15f6475f58721aee4fea9be8cff4f64358
[TLD.git] / git-howto.txt
1 This How-To is about the Git repository in Titanium Linux.
2 You will find here useful examples on how to use git in TLD.
3 Ready? Let's start.
4
5 You need to be a developer to do some of these things.
6
7 I. How do I commit a new .spec file or package to the repository?
8
9 1) Clone an empty repository
10
11 git clone git@git.tld-linux.org:packages/your_new_package
12
13 2) Set your local Email address
14
15 cd your_new_repo
16 git config --local user.email your_git_login@tld-linux.org
17
18 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.
19
20 3) Put your files into the repository and locally add them
21
22 <put your files in here>
23 git add file1 file2 files*
24 git commit
25
26 4) Push your changes to the server
27
28 git push origin master
29
30 If you push your changes for the first time of the repositorys "life", you'll need to add the origin to it.
31 After that you'll be fine doing just:
32
33 git push
34
35 NOTE:
36 It is possible to shorten these commands ex. git add and git commit can be put together into: git commit -a.
37 You can commit several time into you local repository before pushing. You don't need to push each time you commit.
38
39 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?
40
41 This is very unfortunate. Afaik you've got only 2 options.
42
43 1) Delete your commit. This means all of your changes will be lost, but you can store them elsewhere for the time being, right?
44 To do this (after you backed up your changes) type:
45
46 git reset --hard HEAD~1
47
48 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.
49
50 2) The second way is to remove locally your repository and re-clone it. Then put back your changes to it, commit and push.
51
52 III. My new repository didn't show up on the web.
53
54 THIS IS FOR git-admins ONLY
55
56 ssh your_git_login@kraz.tld-linux.org
57 sudo su -
58 su - git
59 ./scripts/packages_enable_gitweb.sh
60
61 That's it. Maybe this will get automated some time.