Item | git | repo |
is what? | Git is an open-source version-control system designed to handle very large projects that are distributed over multiple repositories. | Repo is a tool that Google built on top of Git to manage the many Git repositories, do the uploads to revision control system, and automate parts of the Android development workflow. - from wikipedia |
Download | $ apt-get install git-core | 如果沒有bin資料夾, 則建立 $ mkdir ~/bin 將此資料夾加入環境變數 $PATH $ PATH=~/bin:$PATH 下載repo至~/bin/ $ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo 設置權限為可執行 $ chmod a+x ~/bin/repo |
get code | $ git clone ssh://[user_name]@[IP address]/home/git/[project.git] | $ repo init -u https://android.googlesource.com/platform/manifest $ repo sync |
new branch | $ git branch [branch_new] | $ repo start [branch_new] . |
change branch | $ git checkout [branch_name] | $ repo forall -c git checkout [branch_new] |
new&change branch | $ git checkout –b [branch_new] origin/master | |
rename branch | $ git branch -m [old_name] [new_name] | |
delete branch | $ git branch -d [branch] | |
查詢所知的branch | $ git branch | $ repo branches |
查詢遠端branch | $ git branch -r | |
查詢所有branch | $ git branch -a | |
把branch的所有commit 整合到master |
$ git branch [new_branch] $ git checkout [new_branch] ------develop------ $ git checkout master $ git merge [new_branch] |
|
把branch的單一commit 整合到master |
$ git branch [new_branch] $ git checkout [new_branch] ------develop------ $git checkout master $git cherry-pick [commit id] |
|
new remote branch | $ git branch [new_branch] $ git push origin [new_branch] |
|
查詢變更 | $ git status | $ repo status |
更新code到local | $ git pull | $ repo sync |
上傳 | $ git add $ git commit $ git push |
$ repo upload . |
回復到push前 | $ git reset --soft [commit id] | |
回復到add/rm前 | $ git reset --mixed [commit id] | |
回復到改code前 | $ git reset --hard [commit id] | |
remove a commit | $ git revert commit | |
new tag | $ git tag -a [new_tag] | |
list all tag | $ git tag -l | |
delete tag | $ git tag -d [tag_name] | |
new remote tag | $git tag -a [new_tag] $git push origin --tag $git push origin :refs/tags/[new_tag] |
|
delete remote tag | $ git tag -d [tag_name] $ git push origin :refs/tags/[tag_name] |
|
指定tag貼在哪筆commit後 | $ git log 找到要貼的時間點, 取其commit id前幾碼 $ git tag -a [new_tag] 7c5f24d |
|
建立patch | $ git diff > [xxx.patch] | |
打上patch | $ git apply [xxx.patch] |
總網頁瀏覽量
基礎Note
☪About Me
(1)
免費軟體
(2)
教學
(4)
教學文件
(42)
會計軟體
(1)
電腦系統
(1)
Adapter
(8)
Adobe Premiere
(1)
AlertDialog
(7)
Android App 介紹
(1)
Animation
(1)
API
(2)
APP範例
(1)
Array
(1)
AsyncTask
(1)
Auto Test Case
(32)
AutoCompleteTextView
(1)
Bitmap Drawable
(3)
BroadcastReceiver
(4)
Button
(1)
Codility
(2)
Contact
(4)
DB
(1)
Dialog
(2)
Documents
(1)
Eclipse
(3)
Ellipsize
(1)
File
(4)
Focus
(2)
Fragment
(4)
Gallery
(2)
GIT
(4)
GitHub
(1)
GridView
(8)
HashMap
(1)
HorizontalScrollView
(6)
IIS
(1)
Intent
(3)
IntentService
(1)
Internet
(2)
KeyEvent
(1)
Layout
(1)
ListView
(11)
Log
(1)
Mac / iOS
(11)
Manifest
(1)
Marquee
(2)
Math
(1)
MediaPlayer
(5)
MediaRecorder
(5)
MSMQ
(1)
onClick
(1)
PackageManager
(6)
PHP
(1)
PIS
(3)
PowerManager
(1)
Progress
(2)
SCREEN
(1)
Search
(6)
Service
(1)
SharedPreferences
(3)
SimpleDateFormat
(1)
SonarQube
(1)
Sound Recorder
(1)
Spinner
(2)
SQL server Management
(16)
SQLite
(13)
String
(1)
STS
(5)
SVN
(1)
Thread
(1)
Toast
(3)
Typeface
(1)
Uri
(2)
VB.NET
(17)
VMware
(1)
關於我自己
2012年3月7日 星期三
git V.S repo
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言