Friday, June 15, 2018

git command line helper

Overview 

git command line are difficult to remember for somebody used to Visual Source Safe, Star Team or TFS. But these days you do not have the choice. I came up with this PowerShell Script I called pgit.ps1 that translate command I can remember into git command.

Source: pgit.ps1

PS C:\>pgit list [branch, url, tag, history, merge-history]
PS C:\>pgit create branch branchName
PS C:\>pgit switch branch branchName
PS C:\>pgit delete branch branchName
PS C:\>pgit push branch branchName
PS C:\>pgit rename branch oldBranchName newBranchName
PS C:\>pgit push branch branchName # push branch to the origin server
PS C:\>pgit status
PS C:\>pgit commit # will automatically stage the all the modified files and commit
PS C:\>pgit commit -m "message" # will automatically stage the all the modified files and commit
PS C:\>pgit undo [unstaged, unstaged-staged, last-commited, -untracked-file]

2 comments:

  1. SmartGit is worth a try. Once you understand how it works, it is quick and powerful.

    ReplyDelete
    Replies
    1. I will look at it. But SmartGit is a Windows UI.
      I rather like a command line tools. But git commands are difficult to remember. Do you know any tool that is command based but make the command line easy to remember.
      That is why I created pgit.ps1

      Delete