Cool Git Tricks

Home Forums Linux Club Forum Cool Git Tricks

Tagged: 

This topic contains 1 reply, has 1 voice, and was last updated by  Bryce 1 year, 1 month ago.

  • Author
    Posts
  • #654

    Bryce
    Keymaster

    Everyone, share any cool tricks you have found with git. One thing I have found is this alias:

    [alias]
            graph = log --graph --pretty=format:'%C(auto)%d %h %cr %Cblue%cn %Creset %s'

    Put this in your .gitconfig and then you can type git graph and it will give you a nicer output of you history and branches.

  • #655

    Bryce
    Keymaster

    Here are some other cool commands that you can add to your .bashrc that will let you create new repos and delete ones your done with right from the commandline on github.com.

    You can then do stuff like

    github-init exampleRepo
    and then clone your new repo with
    git clone https://github.com/[YOUR GITHUB USERNAME HERE]/exampleRepo.git

    github-delete exampleRepo and it will be gone

    github-init(){
     curl -u '[YOUR GITHUB USERNAME HERE]' https://api.github.com/user/repos -d '{"name":"'$1'"}';
    }
    
    github-delete(){
     curl -X DELETE -u '[YOUR GITHUB USERNAME HERE]' https://api.github.com/repos/[YOUR GITHUB USERNAME HERE]/$1
    }
    • This reply was modified 1 year, 1 month ago by  Bryce.

You must be logged in to reply to this topic.