Sunday, July 24, 2016

Git & GitHub

git command

  • git clone [github link] [(optional)folder name]
  • git log
  • git log —stat
  • git diff first_id secod_id
  • git checkout
  • q
  • git config —global color.ui auto
    Atom as Git commit editor
    git config --global core.editor "atom --wait"

    make a repository

  • git init
  • git status
  • git add add new work to the staging area, a bridge b/w working directory and repository
  • git add . add all work
  • git commit will open a text editor, write, save and close editor.
  • git commit -m "message no need to open text editor
  • git diff (empty)
  • git diff --staged
  • git reset --hard
  • git branch
  • git branch easy-mode
  • git checkout easy-mode

    GitHub

  • git remote
  • git remote add origin url.git set the url as your remote reference
  • git remote -v stands for verbose
  • git push origin master sync to remote by master branch
  • git pull origin mastersync local by master branch
  • git config --global credential.helper osxkeychain password once for all
    -git pull=git fetch+git merge
  • pull request is actually merge request

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.