Preface
Git 較常用於管理文字檔案,對於Binary File的版控管理,可以用lfs這個指令來進行管理
Tutorial
可以用下列的Git 指令對Repo進行初始化
$ git lfs install
接著可以把Binary File檔案加入進行追蹤
$ git lfs track "*.xlsx"
若是要修改追蹤的Binary File,可以直接對.gitattributes進行修改
$ chmod +x idea
//$PATH:後方可以改為你指定的路徑,這裡舉例使用'.' $ echo "PATH=$PATH:." >> ~/.bashrc
$ idea <project-path>
//先確認目前所做的改動$ git status//使用 stash 儲存起來,save 後面所帶的參數為自定義的 stash 註記$ git stash save these changes are going to apply on develop branch//目前的改動 stash 起來後就可以切換到 develop branch 上了$ git checkout develop//若沒有暫存其他的東西的話可以直接用 stash pop 來還原剛剛暫存東西$ git stash pop
//對當前的 commit 標上版號 $ git tag -a v0.0.x //顯示所有的版號 $ git tag //顯示對應版號其 commit 的詳細資訊 $ git show v0.0.x
$git config user.name = "YOUR NAME" $git config user.email = youreamil@yourdomain.com
$git config --global user.name = "YOUR NAME"最後可以使用 --list 進行所有的 config 設定
$git config --list
$ cd ~/.ssh/
$ ssh-keygen -t rsa -C "your comment"
$ vim config //Config 內容如下 # GitHub.com server Host Github HostName github.com User github_user IdentityFile ~/.ssh/personal_id # Work codebase server Host Your company name HostName 127.0.0.1 #Your id address of your company codebase User your name port 7999 #According the setting of your company codebase IdentityFile ~/.ssh/work_id
$ ssh-add ~/.ssh/work_id $ ssh-add ~/.ssh/personal_id
$ ssh-add -l
$ pbcopy < ~/.ssh/work_id.pub
$ git status
$ git stash
$ git status
$ git stash list
$ git stash apply stash@{0} //stash@{number} 是 stash index 可以在 stash list 裡面找到
$ git add --all $ git commit
$ git status modified a.file modified b.file both modified c.file
#請注意 --ours, --theirs 指的是哪個分支上的 c.file #我們已經切換到 develop branch 上 #所以 --ours 指的是 develop 上的 c.file #欲使用 feature branch 上的 c.file 所以要使用 --theirs $ git checkout --theirs c.file $ git add c.file
$ git status modified a.file modified b.file modified c.file
$ git commit -a
$ git status
$ git commit -a
$ git checkout <develop or master>
$ git pull origin <develop or master>
$ git merge <branch-name>
$ git push origin <develop or master>
git reset --soft HEAD^
$ git commit --amend
$ git push --force-with-lease <repository> <branch>
$ git branch <branch-name>
$ git branch
$ git checkout <branch-name>
$ git status
$ git add <file-path/file-name>
$ git commit <file-path/file-name>
$ git push origin <branch-name>
~/usr/lib/hadoop/client-0.20 加入全部的Jar ~/usr/lib/hadoop/ hadoop-annotations.jar hadoop-auth.jar hadoop-common.jar完成之後就可以,回到專案的/src路徑底下進行撰寫Mapper、Reducer、Driver的程式了。接著將測試分析的資料放到專案路徑底下,加入執行的參數(Arguments),就可以執行專案了。
$mkdir input_txt$mv pg20417.txt pg4300.txt pg5000.txt input_txt
$hadoop fs -copyFromLocal input_txt user/hduser/input_txt$hadoop fs -ls-rw-r--r-- 1 hduser supergroup 710771 2014-10-03 16:13 input_txt/pg20417.txt
-rw-r--r-- 1 hduser supergroup 1573150 2014-10-03 16:13 input_txt/pg4300.txt
-rw-r--r-- 1 hduser supergroup 1423803 2014-10-03 16:13 input_txt/pg5000.txt
$hadoop jar /usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.2.0.jar wordcount /user/hduser/input_txt /user/hduser/output_txt
#若你所使用的帳戶不是hduser,請自行修改指令 $ hdfs fs -mkdir -p /user/hduser