User Tools

Site Tools


soft:git

git

Push to local branch

Source: StackOverflow question

  git push . <src branch>:<dst branch>

Merge two files

Source: StackOverflow question

  git merge-file -p <current> <common> <other>  >  <dest>

-p sends output to stdout, default behaviour is to modify <current>.

To get a common ancestor, you might need to retrieve a previous version of the file.

Source: StackOverflow question

  git show <revision>:<relative path>
  # or
  git show <revision>:<absolute path>

Pretty git log

Sources: StackOverflow questions

Simple output:1)

  git log --all --decorate --oneline --graph
  # git log a dog

Customized simple output:

  git log --all --graph --format='%C(auto)%h %<(16)%C(magenta)%ar%C(auto) %s%d %C(cyan)%an'

Altered normal output:2)

  git log --graph --abbrev-commit --decorate --date=relative --all

Or just use tools like gitkraken, gitk or others.

soft/git.txt · Last modified: 2018/01/03 02:45 by tqdv