Difference between revisions of "EBC Exercise 16 git"

From eLinux.org
Jump to: navigation, search
m (2. Git Basics: Removed line about git completion)
(Fixed typo: "stated" s/b "staged" in second bullet. Corrected "is" to "if" in second last bullet.)
Line 53: Line 53:
  
 
* How do you stage a file?
 
* How do you stage a file?
* How do you view stated and unstaged changes?
+
* How do you view staged and unstaged changes?
 
* How do you view comment history?
 
* How do you view comment history?
 
* You've just committed something and realize you meant to have committed one more file.  How do you add that file to the commit you just did?
 
* You've just committed something and realize you meant to have committed one more file.  How do you add that file to the commit you just did?
 
* How do you unstage a file?
 
* How do you unstage a file?
 
* How do you unmodify a file?
 
* How do you unmodify a file?
* After running the <code>remove -v</code> how do you tell is a site is read only or read/write?
+
* After running the <code>remove -v</code> how do you tell if a site is read only or read/write?
 
* What's the difference between a lightweight and an annotated tag?
 
* What's the difference between a lightweight and an annotated tag?
  

Revision as of 16:44, 16 March 2011


git is a distributed revision control system with an emphasis on being fast. It was initially designed and developed by Linus Torvalds for Linux kernel development. The purpose of this lab is to get hands on experience with git to learn how it works and how to use it.

Much of the material here has come from Pro Git. We'll be using github to practice gitting.

Set Up Git

Go to github and following the directions for installing and setting up git. No need to set up your own repository right now (unless you want to), I already have one set up for you the play with.

I suggest you do this for both your host computer and your Beagle. On the Beagle use

opkg install git

1. Play with git locally

Pro Git has a nice on-line book with lots of good details. I'll lead you through many parts of it. The first chapter is Getting Started. Here are the topics:

1.1 - About Version Control
1.2 - A Short History of Git
1.3 - Git Basics
1.4 - Installing Git
1.5 - First-Time Git Setup
1.6 - Getting Help
1.7 - Summary

I'll cover Git Basics in class and you have already done parts 1.5 and 1.6 to set up for github. I suggest you take a look at Getting Help and then move on.

2. Git Basics

Chapter is on Git Basics. The topics are:

2.1 - Getting a Git Repository
2.2 - Recording Changes to the Repository
2.3 - Viewing the Commit History
2.4 - Undoing Things
2.5 - Working with Remotes
2.6 - Tagging
2.7 - Tips and Tricks
2.8 - Summary

There is lots of good material here. I suggest you work through it all. In section 2.1 is shows how to clone a remote repository. Try using my repository.

git clone git@github.com:MarkAYoder/gitLearn.git

gitk looks like a nice tool. Be sure to take a look at it.

Questions you should be able to answer after doing chapter 2

  • How do you stage a file?
  • How do you view staged and unstaged changes?
  • How do you view comment history?
  • You've just committed something and realize you meant to have committed one more file. How do you add that file to the commit you just did?
  • How do you unstage a file?
  • How do you unmodify a file?
  • After running the remove -v how do you tell if a site is read only or read/write?
  • What's the difference between a lightweight and an annotated tag?

Download my gitLearn repository

Nice git article

Here's a nice article on a common git workflow.

Access ti/staging

Here is what I did to access the ti/staging stuff.

host $ cd ~/oe/openembedded
host $ git remote add gitor git://gitorious.org/angstrom/openembedded.git
host $ git fetch gitor
host $ git checkout gitor/ti/staging -b ti/staging
host $ cd ${OETREE}
host $ wget http://download.berlios.de/bitbake/bitbake-1.8.18.tar.gz
host $ tar -xvf bitbake-1.8.18.tar.g
host $ gedit source-me.txt

Change

PATH=${OETREE}/openembedded/bitbake/bin:${ORG_PATH}

to

PATH=${OETREE}/bitbake-1.8.18/bin:${ORG_PATH}

Save and quit gedit

host $ . source-me.txt
host $ cd ~/oe
host $ mv angstrom-dev angstrom-dev.v0
host $ bitbake console-image