發表文章

目前顯示的是有「git」標籤的文章

Markdown

[GIT] stash

https://git-scm.com/book/zh-tw/v1/Git-%E5%B7%A5%E5%85%B7-%E5%84%B2%E8%97%8F-Stashing 6.3 Git 工具 - 儲藏 (Stashing) 儲藏 (Stashing) 經常有這樣的事情發生,當你正在進行專案中某一部分的工作,裡面的東西處於一個比較雜亂的狀態,而你想轉到其他分支上進行一些工作。問題是,你不想只為了待會要回到這個工作點,就把做到一半的工作進行提交。解決這個問題的辦法就是  git stash  命令。 「儲藏」可以獲取你工作目錄的 dirty state——也就是你修改過的被追蹤檔和暫存的變更——並將它保存到一個未完成變更的堆疊(stack)中,隨時可以重新應用。 儲藏你的工作 為了演示這一功能,你可以進入你的專案,在一些檔上進行工作,有可能還暫存其中一個變更。如果你執行  git status ,你可以看到你的 dirty state: $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: index.html # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # # modified: lib/simplegit.rb # 現在你想切換分支,但是你還不想提交你正在進行中的工作;所以你儲藏這些變更。為了往堆疊推送一個新的儲藏,執行  git stash : $ git stash Saved working directory and index state \ "WIP on master: 049d078 added the index file" HEAD is now at 049d078 added the index file (To restore them type ...

[GIT] alias

https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs https://www.pureweber.com/article/git-pretty-output/ https://git-scm.com/book/zh-tw/v1/Git-分支-分支的新建與合併 [eric_tu@localhost learngit]$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias gc='git checkout' alias gl='git log --oneline --decorate --graph --color' alias grep='grep --color=auto' alias gs='git status' alias gup='git remote update -p;gl' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias vi='vim' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' ~/.gitconfig 1 [color]~ - 2 >...ui = auto~ 3 ~ 4 [alias]~ 5 lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar )%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yel...

[git] 專案練習

[eric_tu@localhost ~]$ git clone ssh://eric_tu@192.168.30.58/home/git/git/eric_tu.git Cloning into 'eric_tu'... remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done. [eric_tu@localhost ~]$ ll 總計 8 -rw-r--r--. 1 eric_tu eric_tu 176 5月 2 22:11 bashrc drwxrwxr-x. 3 eric_tu eric_tu 25 5月 9 01:38 eric_tu drwxr-xr-x. 2 root root 31 5月 2 20:05 linux_basic -rw-r--r--. 1 root root 3996 5月 9 01:15 ssh_backup [eric_tu@localhost ~]$ cd eric_tu/ [eric_tu@localhost eric_tu]$ ll 總計 0 -rw-rw-r--. 1 eric_tu eric_tu 0 5月 9 01:38 1 [eric_tu@localhost eric_tu]$ gl * 07990e9 (HEAD, origin/master, origin/HEAD, master) initial commit [eric_tu@localhost eric_tu]$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias gc='git checkout' alias gl='git log --oneline --decorate --graph --color' alias grep='grep --color=auto' alias gs='git status...

[git] git alias

``` [eric_tu@localhost eric_tu]$ alias alias egrep='egrep --color=auto' alias fgrep='fgrep --color=auto' alias gc='git checkout' alias gl='git log --oneline --decorate --graph --color' alias grep='grep --color=auto' alias gs='git status' alias gup='git remote update -p;gl' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias vi='vim' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' ```