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

星期二, 5月 28, 2013

[Git] 讓你的 Github跟公司的 Git分開

  平常我自己會用 Github放一些我做實驗的網頁工具,而公司也用 Git來做版本控管。當然第一次執行git commit的時候, git會請你輸入你的電子郵件跟姓名,這時候就兩難了。輸入公司的,Github就沒辦法有自己的紀錄在,就是在 github的 Your Contribution (很多塊綠色點點)就會是以公司的帳號而不是以你個人的帳號了,用自己的電子郵件,在公司看git 紀錄應該會被釘。

  所以可以在第一次 git commit輸入自己的,然後再到公司的下面輸入個別的公司的帳號。其指令就是。

  git config [--global | --local] user.name "Your Name"
  git config [--global | --local] user.email "yourmane@domain.com"

  --global就是全體的設定值, --local的就是個別的設定值。  你也可以手動到各個 repository的 .git下面修改config檔案。在最後加上:

  [user]
          name = Kevin Zhuang
          email = kvzhuang@gmail.com

每個 repository就有不同的帳號了。



星期一, 8月 20, 2012

[git] tag checkout memo

Checkout a repository into your Github: (we fork yui3 into our github)
git@github.com:miiicasa/yui3.git

Checkout to your local repository.
git checkout git@github.com:miiicasa/yui3.git somefolder
or
git submodule add git@github.com:miiicasa/yui3.git somefolder

List all tag (go to somefolder):
git tag -l

Checkout tag:
git checkout "v3.6.0"

It will info you that the repository was detached from master.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

Checkout as a branch:
git checkout -b "v3.6.0"