aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2012-11-15 19:19:26 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2012-11-15 19:19:26 +0100
commit3c7136d871ca13058d728aed65485a99d857b5be (patch)
treee9b9a850411e558b3316ecf2bea2b1dd92feda0c
parent53cb292d8671a2bca1d597a82ac3cdb8afcbaa6f (diff)
Esempi di uso per alcune slide
-rw-r--r--introduzione_a_git.rest224
1 files changed, 224 insertions, 0 deletions
diff --git a/introduzione_a_git.rest b/introduzione_a_git.rest
new file mode 100644
index 0000000..0fde3fa
--- /dev/null
+++ b/introduzione_a_git.rest
@@ -0,0 +1,224 @@
+Introduzione a GIT
+==================
+
+.. footer:: LIFO
+
+.. contents::
+ :class: handout
+
+Un nuovo progetto
+-----------------
+
+::
+
+ $ mkdir greeter
+ $ cd greeter/
+ $ git init
+ Initialized empty Git repository in /home/[...]/greeter/.git/
+
+Qualche file
+------------
+
+::
+
+ $ mkdir greeter
+ $ touch greeter/__init__.py
+ $ cat > greeter/greeter.py
+ class Greeter:
+ """ """
+ $ cat > greeter.py
+ #!/usr/bin/env python
+
+ def main():
+ pass
+
+ if __name__ == '__main__': main()
+ $ chmod 755 greeter.py
+
+
+GIT
+---
+
+::
+
+ $ git status
+ # On branch master
+ #
+ # Initial commit
+ #
+ # Untracked files:
+ # (use "git add <file>..." to include in what will be committed)
+ #
+ # greeter.py
+ # greeter/
+ nothing added to commit but untracked files present (use "git add" to track)
+
+
+In staging
+----------
+
+::
+
+ $ git add greeter.py greeter/
+ $ git status
+ # On branch master
+ #
+ # Initial commit
+ #
+ # Changes to be committed:
+ # (use "git rm --cached <file>..." to unstage)
+ #
+ # new file: greeter.py
+ # new file: greeter/__init__.py
+ # new file: greeter/greeter.py
+ #
+
+Altre mod
+---------
+
+::
+
+ $ cat > greeter/__init__.py
+ from greeter import Greeter
+ $ git status
+ # On branch master
+ #
+ # Initial commit
+ #
+ # Changes to be committed:
+ # (use "git rm --cached <file>..." to unstage)
+ #
+ # new file: greeter.py
+ # new file: greeter/__init__.py
+ # new file: greeter/greeter.py
+ #
+ # Changes not staged for commit:
+ # (use "git add <file>..." to update what will be committed)
+ # (use "git checkout -- <file>..." to discard changes in working directory)
+ #
+ # modified: greeter/__init__.py
+ #
+
+
+Commit
+------
+
+::
+
+ $ git add greeter/__init__.py
+ $ git commit
+
+
+::
+
+ Skeleton for the new project.
+ # Please enter the commit message for your changes. Lines starting
+ # with '#' will be ignored, and an empty message aborts the commit.
+ # On branch master
+ #
+ # Initial commit
+ #
+ # Changes to be committed:
+ # (use "git rm --cached <file>..." to unstage)
+ #
+ # new file: greeter.py
+ # new file: greeter/__init__.py
+ # new file: greeter/greeter.py
+ #
+
+::
+
+ ".git/COMMIT_EDITMSG" 14L, 377C written
+ [master (root-commit) b54e94f] Skeleton for the new project.
+ 3 files changed, 9 insertions(+)
+ create mode 100755 greeter.py
+ create mode 100644 greeter/__init__.py
+ create mode 100644 greeter/greeter.py
+
+
+LOG
+---
+
+::
+
+ $ git log
+ commit b54e94fde972281ca31a56ef0d36204addd4906b
+ Author: Elena ``of Valhalla'' Grandi <valhalla@trueelena.org>
+ Date: Thu Nov 15 19:05:42 2012 +0100
+
+ Skeleton for the new project.
+
+
+
+Iniziamo a lavorarci
+--------------------
+
+``greeter/greeter.py``::
+
+ class Greeter:
+ """ """
+
+ def greet(self):
+ print "Hello World!"
+
+``greeter.py``::
+
+ #!/usr/bin/env python
+
+ import greeter
+
+ def main():
+ grt = greeter.Greeter()
+ grt.greet()
+
+ if __name__ == '__main__': main()
+
+Diamo in pasto a git
+--------------------
+
+::
+
+ $ git add greeter.py greeter/greeter.py
+ $ git commit -m 'Generic greetings'
+ [master adfbc73] Generic greetings
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+ $ git status
+ # On branch master
+ nothing to commit (working directory clean)
+ $ git log
+ commit adfbc7340ac1af8b1dc80ebb1526c7b2b9ad4d1f
+ Author: Elena ``of Valhalla'' Grandi <valhalla@trueelena.org>
+ Date: Thu Nov 15 19:08:29 2012 +0100
+
+ Generic greetings
+
+ commit b54e94fde972281ca31a56ef0d36204addd4906b
+ Author: Elena ``of Valhalla'' Grandi <valhalla@trueelena.org>
+ Date: Thu Nov 15 19:05:42 2012 +0100
+
+ Skeleton for the new project.
+
+
+
+
+Finalmente pubblichiamo
+-----------------------
+
+::
+
+ $ $BROWSER http://gitorious.org
+
+Non github?
+-----------
+
+Alternative:
+
+* <http://repo.or.cz/>_
+* gitolite_ + gitweb_ self-hosted
+* ...
+
+.. _gitolite:
+.. _gitweb:
+
+..
+ vim: set filetype=rst: