Git

1名無しさん@Next2ch:2015/03/14(土) 21:26:40.36 ID:S64VQPpL

ソースコード管理を行う分散型バージョン管理システム、Gitについて語ろう。

Git - Fast Version Control System
http://git-scm.com/

◆関連サイト
Pro Git - Table of Contents
http://git-scm.com/book/ja
Git入門
http://www8.atwiki.jp/git_jp/

2名無しさん@Next2ch:2015/03/14(土) 23:26:15.73 ID:36hBr7hV

また支援が足りないな
bashrcか~/.profileに登録しておくと便利なショートカットいくつか
function git_ls(){
git branch
}
function git_cd(){
awk -v node="$1" '
function cmd(E,A,this,v){A[0]=0;while((E |getline v)>0)A[A[0]+=1]=v;A["RETURN_CODE"]=close(E);}
BEGIN{if(node=="")exit;cmd("git branch",A);for(i=1;i<=A[0];i++)sub("^[* ]*","",A[i]);
for(i=1;i<=A[0];i++){if(A[i]~node){E="/bin/bash -c \x27 git checkout \""node"\" \x27 & ";
E|getline v;close(E);break}}exit}'
}

3名無しさん@Next2ch:2015/03/14(土) 23:28:12.14 ID:36hBr7hV

#一時的に他の作業を行う場合
function git_keep_uncommitted_work_and_revert_to_known_state(){
[ "$1" == "" ] && echo "give a hash that points to desired restore state" && return;
git stash
git reset --hard "$1"
git stash pop
}
#即知の安全圏へ退避
function git_revert_to_known_state(){
[ "$1" == "" ] && echo "give a hash that points to desired restore state" && return;
git reset --hard "$1"
}

4名無しさん@Next2ch:2015/03/14(土) 23:31:14.04 ID:36hBr7hV

#即座に保存
function git_save_quick(){
git commit -am "Saved at $(date +"%Y %m %d %A %R:%S %p %s")$1"
}
#ファイルの一部だけ保存
function git_save_partial_choose_what_to_commit(){
[ "$1" == "" ] && echo "give a file name to save bits but not all of" && ret
urn;
[ ! -f "$1" ] && echo "give a file name that exsists" && return;
echo " Usage : will ask what you want to stage. You can:"
echo " hit [s] to split whatever change into smaller chunks."
echo " unchanged line in the _middle_ of the hunk is where hunk will
be split."
echo " Will not work if there is not any such line."
echo " hit [y] to partial save (stage) that chunk"
echo " [n] to ignore (not stage) that chunk"
echo " [e] to manually edit"
echo " [d] to exit or go to the next file."
echo " [?] to get the whole list of available options."
git add -p "$1"
git diff --cached
}
#もっとも最新の保存地点へさらに内容を追加する
function git_save_append_more_changes_to_most_recent_commit(){
git commit --amend
}

5名無しさん@Next2ch:2015/03/14(土) 23:33:32.46 ID:36hBr7hV

#特定のファイルの変更経歴を表示
function git_show_history_of_file(){
[ "$1" == "" ] && echo "give a file name" && return;
[ ! -f "$1" ] && echo "give a file name that exsists" && return;
git log --follow -p "$1"
}
#特定のハッシュの時点で行われた変更点を表示
function git_show_change_made_by_hash(){
[ "$1" == "" ] && echo "give a sha hash, usually 40 bytes, made from 0-9 and a
-f " && return;
git rev-list "HEAD..$1" 2>/dev/null
[ $? -ne 0 ] && {
echo "Hash [$1] does not exsist. Specify a valid commit.";
echo "Possible canidates are..."
git log |grep "${1:0:8}";
[ $? -ne 0 ] && {
{ git log |grep "${1:0:5}"; } || { [ ${#B} -gt 5 ] && git log |grep "${1:0-5:5}"; }
[ $? -ne 0 ] && {
echo "Unable to find any match. Is that really a sha hash of a commit?"
}
}
return 1;
}
git show "$1";
}

6名無しさん@Next2ch:2015/03/14(土) 23:35:35.38 ID:36hBr7hV

あとGitHubのリンクとかcgitの導入方法とかあったほうがいいかも>>1

7名無しさん@Next2ch:2020/05/04(月) 15:51:12.96 ID:SIvsf1jd

GitHubでContribution activity?ていうの?自分がいつどんな活動してるか知られたくないんだけど、非表示にはできないの?

8名無しさん@Next2ch:2020/05/04(月) 16:13:49.75 ID:XXmhtBrD

緑色のマス目のやつか

9名無しさん@Next2ch:2020/05/04(月) 19:20:57.23 ID:SIvsf1jd

そーそー

10名無しさん@Next2ch:2020/05/04(月) 19:48:10.62 ID:z0wh3Pei

ありゃ確かメルアドが設定してなければマスの色は変わらない
今までの編集歴はどうにもならないと思うけど


レスを書き込む