Git

Git (/ɡɪt/) is a distributed version-control system for tracking changes in source code during software development. It is designed for coordinating work among programmers, but it can be used to track changes in any set of files. Its goals include speed, data integrity, and support for distributed, non-linear workflows wiki

  1. Git Repositories

Git Repositories

  1. Build a git reposotories
     $ git init or $ git init --bare --shared
     $ git add *.c
     $ git add README
     $ git config --global user.email "you@example.com"
     $ git config --global user.name "Your Name"
     $ git commit -m 'initial project version'
    
    • with clone from git repositories
     $ git clone {url}
    
  2. Remote repositories
    • lookup remote git repositories
     $ git remote
     $ git remote -v
     bakkdoor  git://github.com/bakkdoor/grit.git
     cho45     git://github.com/cho45/grit.git
     ...
     origin    git@github.com:mojombo/grit.git
    
  • add remote git repositories

    $ git remote add {abbr} {url}
    ...
    $ git remote
    origin
    $ git remote add pb git://github.com/paulboone/ticgit.git
    $ git remote -v
    origin git://github.com/schacon/ticgit.git
    pb git://github.com/paulboone/ticgit.git
    
  • fetch/pull remote git repositories

    $ git fetch {remote-name}
    or
    $ git pull {remote-name}  // fetch & merge
    
  • push remote git repositories

    $ git push {remote-name} {branch}
    $ git push origin master
    

© 2018. All rights reserved.

Powered by Hydejack v8.4.0