logo img Philippe Morier
  • |
  • Home
  • |
  • Cards
  • |
  • About
  • |
  • Search
  • |
  • Tags
  • |

GIT

  • Generating a new SSH key and adding it to the ssh-agent
  • Add auto-completion in bash
    • git-completion.bash
    • On most Linux distributions it is already installed but maybe broken, if so run:
      sudo apt-get install git-core bash-completion
  • Add branch name to shell
    • git-prompt.sh
    • .bashrc
      # GIT prompt
      . ~/Projects/git-prompt.sh
      export GIT_PS1_SHOWDIRTYSTATE=1
      export PS1='\[\e[1;32m\]\u\[\e[m\]@\[\e[33m\]\h\[\e[m\]:\[\e[34m\]\w\[\e[m\]$(__git_ps1 " (%s)")\$ '
      
    • http://ezprompt.net/
  • GIT Aliases
    git config --global alias.co checkout
    git config --global alias.br branch
    git config --global alias.ci commit
    git config --global alias.st status
    git config --global alias.sr "log --all --oneline -S"
    
  • GIT rerere (Reuse recorded resolution of conflicted merges)
  • GIT push –force-with-lease
  • GIT rebase –interactive
  • Pro Git (book)
  • Tag
  • vcs

Copyright 2024