Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts

Saturday, November 23, 2013

Forkin and Pushin

working tree - your unstaged files
index - staged files
snapshot - in source control

git status -s

git log

 see hash of snapshot contents. each commit get new hash, usually can abbreviate hash using first 7 chars of the hash

git show <hash>

git gui

git log --pretty=raw or oneline

https://gist.github.com/ralfebert/515937

git checkout restores the files from the index

git diff 7char1...7char2 or git log -p

git tag labelname1 7char1 gives a tag to a commit

use a branch to create changes seperate from our main changes (i.e. master)

branch is a label to a commit - git branch -v

git branch newfeature creates a branch

switch between branches using git checkout <branchname>

if you are positioned on master you can do git merge newfeaure

gitk can be entered at command prompt

remotes is connection from one git repository to another

git remote -v shows connections

push your master to git hub (i.e. origin) : git push -u origin master

merging happens automatically when pulling from remote

In GitHub , What is a Fork
At some point you may find yourself wanting to contribute to someone else's project, or would like to use someone's project as the starting point for your own. This is known as "forking"
[more]

https://help.github.com/articles/using-pull-requests


Pull requests let you tell others about changes you've pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.
There is the git-flow . See talk

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.

http://teach.github.com/presentations/git-foundations.html

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.
http://www.youtube.com/user/GitHubGuides
http://teach.github.com
http://teach.github.com/presentations/
https://github.com/github/teach.github.com
http://training.github.com/web/
http://training.github.com/web/free-classes/
https://github.com/githubteacher

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

Tuesday, October 29, 2013

Git Hub comes to train at NCSU

I am signed up for the November GitHub training at NCSU . 
will lead you carefully through the basic skills you need to be productive with Git and to collaborate with other developers on GitHub. Learn how to convert an existing project to a Git Repository, track changes to your project, protect your work from experimental changes through branching, push code to repositories on GitHub, and collaborate with colleagues through Pull Requests
This sounds great. I have been through the basics of creating at GitHub account.  Here is an extensive list of Git resources I have found on the web.

GitHug , Git Workflow , Git Tutorials on You Tube,  Git like a Boss , Skills Matter Git Hub , Merge or Rebase , Pro Git, Git From The Bottom Up , Git Immersion , Git internals  , Git Magic ,
Git Reference, Version Control by Example, Git Succinctly , Think Like (a) Git,Git In The Trenches , Conversational Git , Code School - Try Git

Thursday, October 3, 2013

Git Hubbing

Brent Beer came to Talk GitHub at the TriJug but i missed it.

Linus Torvalds created git, ideas from bitkeeper , says he built it in two weeks.

Distributed means no one place has the server. offline capable. On your own branch where as CVS struggled with branching. Git  like a boss

Here is how i learned Git which walks you thru generating ssh keys :

C:\Program Files (x86)\Git\bin\ssh>ssh-keygen -t rsa -C “yagottabelieve@gmail.com”
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xyz/.ssh/id_rsa):
Created directory ‘/c/Users/xyz/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/xyz/.ssh/id_rsa.
Your public key has been saved in /c/Users/xyz/.ssh/id_rsa.pub.
The key fingerprint is:
go to .ssh dir and get text of pub key
C:\Users\xyz\.ssh>type id_rsa.pub
paste it into github ssh (https://github.com/settings/ssh)
Test out key:
C:\Users\xyz\.ssh>ssh -T git@github.com
C:\Users\xyz\.ssh>git config –global user.name “Dave-o”
C:\Users\xyz\.ssh>git config –global user.email “yagottabelieve@gmail.com”
GitHub for Windows includes this helper, and provides a git shell so you don’t need to install and configure git manually
cd c:\wamp\www\jquery
git add file1.txt
git commit – m “add test file “
git remote add orgin git@github.com:technobuzz/jquery.git
git pull orgin master
git push  orgin master

git_basics_tutorial_example
Usually if I have been working on another machine and have already committed my changes to GitHub, so I can just pull down all the latest code, and start where I left off by using: git pull

git simple guide

your local repository consists of three "trees" maintained by git. the first one is your Working Directory which holds the actual files. the second one is the Index which acts as a staging area and finally the HEAD which points to the last commit you've made.

workflow for submitting pull requests

Forking a repository Before you can begin editing code you must first create a fork of the GitHub repository you wish to contribute to. Navigate to the GitHub page of the repository you wish to fork. Click on the fork button on the top right corner of the page.

http://chronicle.com/blogs/profhacker/forks-and-pull-requests-in-github/47753

Unlike giving a “star” to a project, which is similar to a Facebook “like” button, when you fork a GitHub project, you are making a somewhat different statement. You are not just saying, “I could use what you wrote,” since a clone is sufficient for that purpose. You are saying, “I could use your text and want to improve it.”


https://help.github.com/articles/creating-gists
Gist is a simple way to share snippets and pastes with others. All gists are Git repositories, so they are automatically versioned, forkable and usable from Git.
Few Git Hub accounts