Monday, 15 August 2011

Git init

tips:

use README.md and u have

# h1
# h2
# h3
################ = line
tab

  • Global setup:

    Set up git
    git config --global user.name "John Kolovos"
    git config --global user.email yannis.kolovos@gmail.com


    Next steps:

    mkdir html5boilerplate_t
    cd html5boilerplate_t
    git init
    touch README
    git add README
    git commit -m 'first commit'
    git remote add origin git@github.com:msroot/html5boilerplate_t.git
    git push -u origin master


    Existing Git Repo?

    cd existing_git_repo
    git remote add origin git@github.com:msroot/html5boilerplate_t.git
    git push -u origin master



    Git branches:

    git branch testing
    new branch testing local

    git pull testing
    pulls from testing


    git checkout master

    git merge testing
    If the changes don't conflict, you're done. If there are conflicts, markers will be left in the problematic files showing the conflict;




    $ git commit -a

    will commit the result of the merge. Finally,


    gitk



    delete branch
    msRoot:HTML5-TEMPLATE ioannis$ git branch -d deleteme
    Deleted branch deleteme (was 8c06f75).




    msRoot:HTML5-TEMPLATE ioannis$ git branch opa
    msRoot:HTML5-TEMPLATE ioannis$ git branch
    * master
    opa

    msRoot:HTML5-TEMPLATE ioannis$ git checkout opa
    Switched to branch 'opa'

    msRoot:HTML5-TEMPLATE ioannis$ git branch
    master
    * opa
    msRoot:HTML5-TEMPLATE ioannis$



    REMOTE

    msRoot:HTML5-TEMPLATE ioannis$ git branch -r
    origin/master
    msRoot:HTML5-TEMPLATE ioannis$


    view remote

    http://book.git-scm.com/3_basic_branching_and_merging.html



    msRoot:HTML5-TEMPLATE ioannis$ git branch -a
    master
    * opa
    remotes/origin/master
    [1]+ Done gitk --all



  • No comments:

    Post a Comment