DEV] My `.gitconfig`

in #kr9 years ago (edited)

I thought about what to write on Steemit for a while, and decided to share some useful dev tips as my second post.

I saw many developers just use default .gitconfig settings, but there're many useful tunings that can make your day-to-day work a lot easier.

스팀잇에 이제 막 입문해서, 뭘 써야 하나 좀 고민했었는데.. 개발 관련 팁들을 공유하는 컨셉으로 해보려고 합니다.
제 두번째 포스트는 그래서 제 .gitconfig 파일입니다.

많은 개발자분들이 그냥 기본 세팅으로 GIT을 사용하시는 경우가 많은것 같은데요, 몇가지 설정으로 더 아름다운 개발 환경을 만들어봅시다!

[user]
  # Please do not push your code "Anonymously" if you work with bunch of other team members
  # 협업을 할때는 꼭 이름과 이메일을 설정해서 익명으로 푸시를 하지 말아주세요.
  name = Your name
  email = [email protected]

[color]
  status = auto
  branch = auto
  diff = auto
  ui = auto

[color "diff"]
  meta = yellow bold
  ifrag = magenta bold
  whitespace = red reverse

[alias]
  # Just some shorter alias saving few keyboard typing on frequently used operations
  # 자주쓰는 명령어에 대한 더 짧은 별명을 지어줘서 키보드 타이핑 몇번정도를 줄여보세요 ㅎ
  s = status
  b = branch
  co = commit

  # Find files by name on repository
  # 레포지토리 안에 있는 파일 - 이름으로 검색
  f = "!git ls-files | grep -i"

  # Print how many commits you made so far (could be useful for versioning)
  # 커밋 갯수 카운트 (versioning 하실때 유용합니다)
  count = rev-list --count HEAD

  # This is just a prettier version of git log command - try it! this is my favorite one
  # 더 아름다운 버전의 git log 입니다. 이건 정말 꼭 한번 해보세요! 강력추천입니다 ㅎ
  lg = log --color --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit


[branch "master"]
  remote = origin
  merge = master

[core]
  # Did you know Mac's default file system is actually case insensitive?
  # This option force your repository to be case sensitive,
  # so you don't have trouble when you deploy them on Linux (which use case sensitive file system)
  # 맥의 파일시스템이 기본적으로 대소문자 구분을 하지 않는다는걸 아셨나요?
  # 리눅스에서는 File과 file 두개의  파일이 동시에 한 디렉토리에 존재 할 수 있지만 맥에서는 불가능합니다.
  # 아래 옵션을 켜서 맥에서 개발한 경우에 리눅스에서 문제가 발생할 수 있는 경우를 미연에 방지할 수 있습니다.
  ignorecase = false

[branch]
  # Prevent `git pull` from making garbage "merge commits" - Use rebase by default
  # `git pull` 할때 쓰레기 merge 커밋을 만들지 않고 rebase를 기본으로 사용하게 합니다.
  autosetuprebase = always

[push]
  default = simple

[remote "origin"]
  push = HEAD

I'll show you how much better your git log can be with the git lg command we just set up.
위의 git lg 명령어를 사용한 더 아름다운 버전의 git log 화면 스샷으로 글을 마칩니다 :)

git log

git log (default)

git lg

git lg (our prettier version)

Sort:  

반갑습니다.
git 제가 쓰는 git alias 입니다.

ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
tree = log --graph --oneline --all

Congratulations @tabris! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Comment
Award for the number of upvotes

Click on any badge to view your own Board of Honnor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Upvoted.
After seeing your last post and this... you have gotten a new follower. Love the blogs,