Tuesday, November 19, 2013

Git up and go

Today I took in the Git Foundations training by Tim Bergland at the Witherspoon building (located at 2810 Cates Ave. on the  NCSU campus).  I can confirm if you park at 2815 Cates Ave, you might expect a parking violation warning on your windshield.


On learning about why you have to invoke the add command twice on successive writes to the GIT repository.  why add twice??? three stage thinking (why u add everytime) :

working (tree)  --- edit   ->  
staging (i.e. status tells just YOU add/remove to empty shopping cart) ->
history (commit - together)

On the git log and how to create a git alias  (i.e. git lol)

provides date, author, 40 char commit id
C:\gittrain>git config --global alias.lol "log --graph --decorate --oneline --all"

Learned that branching is giving the "commit you are on" a label. You can only be on one branch at a time, and by default, you are on master 

C:\gittrain>git branch
* master

create a branch
C:\gittrain>git branch feature
Now on Branch feature
C:\gittrain>git lol
* 5390c82 (HEAD, master, feature) more books info
* 877cb2e Initial commit

Add file to branch staging
C:\gittrain>git add raven.txt.

Commit file
C:\gittrain>git commit -m "add brnch"
[master 82168b5] more barnch
 1 file changed, 3 insertions(+), 1 deletion(-)

switch to branch 'feature'
C:\gittrain>git checkout feature

Switched to branch 'master'
C:\gittrain>git checkout master

merge feature into master
C:\gittrain>git merge feature - m "merged"

delete feature branch (branch is just name for a commit)

C:\gittrain>git branch -d feature

The transcript of the class can be found here.

Saw this link today on Git Hub evolution by Zach Holman . Also, a link on effective-git-branching-and-release-management

1 comment:

  1. You have sooo many useful information in your blog. I think every user will find here an answer to his question. If you do not mind, I will share your expert opinion in my how to promote app blog.