顯示具有 git 標籤的文章。 顯示所有文章
顯示具有 git 標籤的文章。 顯示所有文章

2015年4月21日 星期二

Git Usage

Git Basics

Git Commands
git clone
git pull
  --rebase: Instead of a merge, perform a rebase after fetching.
git push
git remote
  -v, --verbose
  set-url <name> <url>

git log
git diff
git tag
  -a <tagname> <commit>
git describe
git status
git-rev-parse

git add
git rm
git mv
git reset
git revert
git commit
  --ammend*
  Git 版本控制系統(3) 還沒 push 前可以做的事

git branch
  branch: create a new branch.
  -d branch: Delete a branch. The branch must be fully merged in HEAD.
  -D branch: Delete a branch irrespective of its merged status.
git checkout
  branch: switch to branch
  path: discard changes on working copy
git merge
git rebase
  branch: Forward-port local commits base on the branch.
  Git 分支 - 分支的新建與合併
  Git Branch 的操作與基本工作流程
  使用 git rebase 避免無謂的 merge
  Pull with rebase

2015年4月14日 星期二

Github Usage

Change the repository URL of local working copy:
View the current origin URL:
$ git remote -v
$ git remote set-url origin https://github.com/<user>/<repo>.git

If you try to access the repository (clone, push, ...etc) via HTTP/HTTPS, the following error occurred:
error: The requested URL returned error: 403 while accessing https://github.com/user/repo.git/info/refs
fatal: HTTP request failed
Use SSH (get the URL from the repository):
$ git remote set-url origin git@github.com:<user>/<repo>.git



Connecting over SSH
If you clone with SSH, you must generate SSH keys on each computer you use to push or pull from GitHub.

Note: you can use the ~/.ssh/config to setup the SSH authentication instead of ssh-agent


Template of .gitignore
https://github.com/github/gitignore


Reference:
https://help.github.com/set-up-git-redirect
https://help.github.com/create-a-repo
https://help.github.com/articles/fork-a-repo/
https://help.github.com/articles/https-cloning-errors/

https://help.ubuntu.com/lts/serverguide/git.html