git clone --shared repository | clone後のリポジトリーを共有する
4月 30th, 2012
git clone したリポジトリーを共有するには
(例: usersグループに入っている人同士
同じグループで permission 775の時
git initだけの場合、他の人が書き込もうとするとエラー
$ git add test
fatal: Unable to create ‘/home/git/share_tmp/.git/index.lock’: Permission denied
shared=trueとする
git init --shared=true
.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
[...]
remove a remote branch | git
3月 13th, 2012
マージし終わって要らなくなったリモートのブランチを消してみる。
* git branch -r
origin/HEAD -> origin/master
origin/ebook
origin/master
* git branch -rd origin/ebook
origin/HEAD -> origin/master
origin/master
ローカルのものを消すのは、
* git branch -d origin/ebook
リモートに追加
* git push origin ebook
既にコミットされているファイルを無視する gitignore ? update-index
2月 27th, 2012
To ignore uncommitted changes in a file that is already tracked
use git update-index --assume-unchanged.
ということで。既にトラックされているファイルを無視するには
例)既にコミットされている web/index.php の変更をコミットしたくない場合。
$ git status
# On branch master
# Changes not staged for commit:
# (use “git add …” to update what will be committed)
# (use “git checkout -- …” to discard changes in working directory)
#
# [...]
.gitignore
2月 23rd, 2012
こんな状態で
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use “git add …” to include in what will be committed)
#
# .DS_Store
# 512icon.png
# android.tmp/
# android/
# [...]
resolv conflict when git stash pop | Git
12月 27th, 2011
conflictしたので、mergeしてみる。
git stash
git pull
したら、conflictと出たので
該当ファイルはこんな感じに。
<<<<<<< Updated upstream
protected static $lang_codes;
public static function initLangCodes(){
if(empty($lang_codes))
self::$lang_codes = array( ‘en’,'ja’,'cn’,'fr’ );
}
public static function getLangCodes(){
self::initLangCodes();
return self::$lang_codes;
}
public static function checkLangCode($code){
self::initLangCodes();
[...]
Git Tag
8月 16th, 2011
$ git tag -a v1.0.4 -m ‘gr v1.0.4′
$ git tag
v1.0.4
$ git show v1.0.4
tag v1.0.4
Tagger: 大竹 潤一
Date: Tue Aug 16 13:36:36 2011 +0900
gr v1.0.4
タグのpush
$ git push origin v1.0.4
junichi@111.111.111.177’s password:
Counting objects: 1, done.
Writing objects: 100% (1/1), 188 bytes, done.
Total 1 (delta 0), reused 0 (delta 0)
To 000.000.000.177:/home/git/appengine/project
* [new tag] [...]
Cygwin で Git
6月 3rd, 2011
gitをwindows上でも動かすために。cygwinをいれる。
http://www.cygwin.com/
cygwin.exeでインストールするときに
git
ssh
をチェックしました。
cygwinを起動して。
$ mkdir git
$ cd git
で
$ git clone 111.111.111.111:/home/jun/git/grTestBase grTestUse
でローカルで出来ました。
Git 複数個所の変更を選択して add
6月 2nd, 2011
2箇所離れている場所を変更して
git add -pを利用すると変更箇所ごとに確認が出ます。
$ git add -p
diff --git a/test.txt b/test.txt
index 43eb1f4..63b004f 100644
--- a/test.txt
+++ b/test.txt
@@ -1,6 +1,7 @@
test
a
-2
+b
+30
3
4
x
Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? y
@@ -36,4 +37,5 @@ z
111
+99999
212
Stage this hunk [y,n,q,a,d,/,K,g,e,?]? n
これで上の更新のみaddされます。
$ git diff
diff --git a/test.txt b/test.txt
index d10d14a..63b004f 100644
--- a/test.txt
+++ b/test.txt
@@ -37,4 +37,5 @@ z
111
+99999
212
下の更新はまだaddしていません。
add下部分のみの確認は
$ git diff --cached
diff --git a/test.txt [...]
Git init, add, commit
6月 2nd, 2011
自分のユーザー以下のディレクトリを作成してgitで管理してみる。
git config 自分の情報
$ git config --global user.name “Junichi Otake”
$ git config --global user.email “j***@gmail.com”
$ git config --global color.ui auto
$ cat /home/jun/.gitconfig
[user]
name = Junichi Otake
email = j***@gmail.com
[color]
ui = auto
mkdir -p /home/jun/git/grtest/
cd git/grtest/
$ [...]
git install
12月 23rd, 2010
#yum install git
Installing:
git x86_64 1.5.5.6-4.el5 epel 3.4 M
Installing for dependencies:
perl-Error [...]