Programming2015. 9. 19. 17:22

git과 repo 이야기

-------------


Using repo and git

git config sample, alias in git config?

sudo apt-get install g++-multilib bison g++-multilib git gperf libxml2-utils make python-networkx zlib1g-dev:i386 zip

-------------

git diff

git diff --cached


git rm <file>

git rm --cached <file> ; unstaging

git reset HEAD <file> ; unstaging

git checkout -- <file>; unmodify


git log
--oneline
--decorate
--remote
--no-merges = --max-parents=1

--stat : show modified files

--graph : ascii graph

--pretty : show commit in alternate format


--since, --after

--until,--before

--author

--committer

-------------

git gui = gitk

install xming and set putty X11 forwarding

-------------

git branching is killer feature
incredibly lightweight
git branch <branch>
git checkout -b <branch>
git merge <branch_src> ; merge branch_src to current branch
will create 'merge commit'

git fetch orgin

merge or rebase

-------------

git clone [git url]

git clone [git url] [dir name]

-------------

git pull = fetch + merge

or

git pull = fetch + rebase

or

git pull = fetch

-------------

git push orgin HEAD:remote

git push orgin HEAD:refs/for/BRANCH

refs/for = gerrit server.

Change-ID is for gerrit server.

$ git push ssh://review-android.quicinc.com:29418/PROJECT HEAD:refs/for/BRANCH
$ git push ssh://review-android.quicinc.com:29418/PROJECT COMMIT_ID:refs/changes/CHANGE_NUM

git clone git://PATH/PROJECT.git

cd PROJECT

$ git remote

quic

$ git remote -v

quic    ssh://git.quicinc.com:29418/platform/vendor/qcom/msm8992 (fetch)

quic    ssh://git.quicinc.com:29418/platform/vendor/qcom/msm8992 (push)


Adding remote repositories
git remote add [shortname] [url]
git remote add pb git://github.com/paulboone/ticgit.git

git fetch [remote-name]
git fetch pb

$revp
path=device/qcom/msm8992; project=platform/vendor/qcom/msm8992; refs=LA.BF64.1.2.1
git push [remote] HEAD:refs/for/BRANCH
git push quic HEAD:refs/for/LA.BF64.1.2.1 ; 이 command가 먹힐지 궁금

git remote rename pb paul
$ git remote
orgin
paul

-------------

git format-patch HEAD^
scripts/checkpatch.pl 0001-xxxx.patch
or
git show HEAD | scripts/checkpatch.pl -

git format-patch FROM...TO
  • How to apply patch
git apply --stat PATCH.patch ; just to check
git apply PATCH.patch
patch -p1 <PATCH.patch
git am < 000*
git am -3 < 

-------------

repo init

-u url
-m manifest, otherwise default.xml
-b specify revision branch

repo sync
[project list]
at first = git clone
already done = git remote update; git rebase orgin/<branch>

repo start <branch> -all
starting from the revision specified in the manifest.
git checkout (starting from the revision)
        + git branch <branch>

repo upload
[project list]
git push

repo forall -c [git commands]

-------------

git command alias for bash

### Git command

alias gbr='git branch'

alias gcm='git commit'

alias gco='git checkout'

alias gst='git status'

alias gd='git diff'

alias gdf='git diff'

alias gad='git add'

alias gch='git cherry-pick'

alias gcl='git clean -x -f -d'

alias gf='git format-patch'

alias ghe='git help'

alias gres='git reset --hard HEAD'

alias gr='git rebase'

alias gre='git rebase'

alias gl='git log --oneline --decorate'

alias gll='git log --stat --decorate'

alias gs='git show'

alias gbl='git blame'

------------

'Programming' 카테고리의 다른 글

Book - EXCEL Hacks  (0) 2015.09.24
file/directory 비교 tool - Meld  (0) 2015.09.24
bash alias  (0) 2015.09.19
codeaurora.org and linaro.org  (0) 2015.09.13
Natural Language Processing with Python  (0) 2015.08.24
Posted by 쁘레드