Meego Wiki
Views
From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
m (moved Brief-git-guide to Brief git guide: remove dashes)
(cut toplevel heading, wikify, categorize)
Line 1: Line 1:
-
= Brief Git Guide =
+
Git is handy version control for collaborative development and testing. This guides you briefly through basics to get started. Only terminal usage under Linux is covered, for graphical user interfaces please refer guides available at web.
-
 
+
-
Git is handy version control for collaborative development and testing.
+
-
This guides you briefly through basics to get started.  
+
-
Only terminal usage under Linux is covered, for graphical user interfaces please refer guides available at web.
+
'''Note''' - this was not placed under developer nor testing because it's common for all MeeGo contributors.
'''Note''' - this was not placed under developer nor testing because it's common for all MeeGo contributors.
Line 9: Line 5:
== Concepts ==
== Concepts ==
-
Please open [http://www.cheat-sheets.org/saved-copy/git-cheat-sheet.pdf excellent git cheat sheet]
+
Please open the [http://www.cheat-sheets.org/saved-copy/git-cheat-sheet.pdf excellent git cheat sheet]. Work flow is illustrated in the upper-right corner of cheat sheet. The most basic flow with an existing repository goes like:
-
Work flow is illustrated in the upper-right corner of cheat sheet.  
+
-
The most basic flow with existing repository goes like:
+
=== 1. Create ===
=== 1. Create ===
-
  git clone <repository>
+
git clone <repository>
Example:  
Example:  
-
  git clone git://gitorious.org/meego-quality-assurance/handset-ux-tests.git
+
git clone git://gitorious.org/meego-quality-assurance/handset-ux-tests.git
=== 2. Change ===
=== 2. Change ===
Line 27: Line 21:
=== 3. Commit changes ===
=== 3. Commit changes ===
    
    
-
  git add <newfile> (if you created new file)
+
git add <newfile> (if you created new file)
-
  git commit -a  
+
git commit -a  
Your default editor is opened and you need to write description of changes.
Your default editor is opened and you need to write description of changes.
Line 34: Line 28:
=== 4. Push changes to share ===
=== 4. Push changes to share ===
   
   
-
  git push (this assumes you have commit rights to repository, please check with repository admin)
+
git push (this assumes you have commit rights to repository, please check with repository admin)
''' That's it! Congratulations! '''
''' That's it! Congratulations! '''
Line 43: Line 37:
Ubuntu:  
Ubuntu:  
-
  sudo apt-get install git
+
sudo apt-get install git
=== Optional - If working behind ssh-proxy ===
=== Optional - If working behind ssh-proxy ===
Line 51: Line 45:
Make sure you have following $USER/.ssh/config for your user account
Make sure you have following $USER/.ssh/config for your user account
-
  host proxy  
+
host proxy  
-
    HostName '''<yoursshproxyhere>'''
+
  HostName '''<yoursshproxyhere>'''
-
    user '''<youruseraccounthere>'''
+
  user '''<youruseraccounthere>'''
-
    Compression no
+
  Compression no
-
    LocalForward 2227 gitorious.org:22
+
  LocalForward 2227 gitorious.org:22
-
  host gitorious.org
+
host gitorious.org
-
    User git
+
  User git
-
    HostName 127.0.0.1
+
  HostName 127.0.0.1
-
    Port 2227
+
  Port 2227
    
    
Run the following command:
Run the following command:
-
  ssh -f -N proxy
+
ssh -f -N proxy
-
  <type password for your account, if required>
+
<type password for your account, if required>
''Please note that you need to open proxy connection every time you change network or disconnect/connect from network''
''Please note that you need to open proxy connection every time you change network or disconnect/connect from network''
Now you can clone and push over ssh proxy to '''gitorious.org''', test as follows:
Now you can clone and push over ssh proxy to '''gitorious.org''', test as follows:
-
  git clone git://gitorious.org/meego-quality-assurance/handset-ux-tests.git
+
git clone git://gitorious.org/meego-quality-assurance/handset-ux-tests.git
 +
 
 +
[[Category:Tutorial]]

Revision as of 11:38, 7 April 2011

Git is handy version control for collaborative development and testing. This guides you briefly through basics to get started. Only terminal usage under Linux is covered, for graphical user interfaces please refer guides available at web.

Note - this was not placed under developer nor testing because it's common for all MeeGo contributors.

Contents

Concepts

Please open the excellent git cheat sheet. Work flow is illustrated in the upper-right corner of cheat sheet. The most basic flow with an existing repository goes like:

1. Create

git clone <repository>

Example:

git clone git://gitorious.org/meego-quality-assurance/handset-ux-tests.git

2. Change

<edit or create files with your favorite tools / editors>

3. Commit changes

git add <newfile> (if you created new file)
git commit -a 

Your default editor is opened and you need to write description of changes.

4. Push changes to share

git push (this assumes you have commit rights to repository, please check with repository admin)

That's it! Congratulations!

Pre-steps

Mandatory - Make sure you have git installed

Ubuntu:

sudo apt-get install git

Optional - If working behind ssh-proxy

If you are working with corporation you might need to resolve ssh-proxy challenge.

Make sure you have following $USER/.ssh/config for your user account

host proxy 
 HostName <yoursshproxyhere>
 user <youruseraccounthere>
 Compression no
 LocalForward 2227 gitorious.org:22
host gitorious.org
 User git
 HostName 127.0.0.1
 Port 2227
 

Run the following command:

ssh -f -N proxy
<type password for your account, if required>

Please note that you need to open proxy connection every time you change network or disconnect/connect from network

Now you can clone and push over ssh proxy to gitorious.org, test as follows:

git clone git://gitorious.org/meego-quality-assurance/handset-ux-tests.git
Personal tools