Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Alex (avolkov@mastodon.xyz)'s status on Thursday, 13-Sep-2018 16:45:14 EDT Alex Alex

    Shallow dive into #git aliases.

    I've been perplexed with git shortcuts because it's not your regular unix command and I don't want to solve things by adding more obscure shell commands I can't remember.

    Simple git alias shorthand is easy --

    git config --global alias.co checkout

    Longer aliases are more difficult, but possible. Add the following to ~/.gitconfig to save a lot of typing when tracking remote origin --

    [alias]
    track = "!f(){ git branch --track $1 origin/$1; }; f"

    1/2

    In conversation Thursday, 13-Sep-2018 16:45:14 EDT from mastodon.xyz permalink
    1. Alex (avolkov@mastodon.xyz)'s status on Thursday, 13-Sep-2018 16:52:14 EDT Alex Alex
      in reply to

      Shallow dive into #git aliases. 2/2

      To debug git aliases run this command

      $ export GIT_TRACE=1

      What I have accomplished is I'm able to track remote branch by typing only

      $ git track <remote_branch_name>

      If I want to track and switch, I can use aliases recursively

      [alias]
      swtrack = "!f(){ git track $1; git checkout $1; }; f"

      Further reading:

      Git Aliases -- https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

      One weird trick for powerful Git aliases -- https://www.atlassian.com/blog/git/advanced-git-aliases

      In conversation Thursday, 13-Sep-2018 16:52:14 EDT from mastodon.xyz permalink

      Attachments

      1. Invalid filename.
        One weird trick for powerful Git aliases
        By Nicola Paolucci from Atlassian Blog
        One weird trick for powerful Git aliases
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.