-
Notifications
You must be signed in to change notification settings - Fork 0
Shortcuts for git (and other) commands
Tim Cejka edited this page Aug 31, 2022
·
2 revisions
One easy way to create shortcuts for common git commands is to use bash aliases. E.g., this way you can simply type gs rather than git status.
-
Find and open
.bash_profileas a text file- E.g., my
.bash_profileis inMac/Users/tcejka.
- E.g., my
-
Add the aliases that you want to create using the
aliascommand:alias [shortcut] = '[command]'
-
Save the
.bash_profile. -
Restart your terminal/SSH session or type
source ~/.bash_profilein the terminal for the change to take effect.
#[Aliases]
alias ga='git add'
alias gc='git commit'
alias gs='git status'
alias gb='git branch'
alias glast='git log -1'
You can also create aliases for other SSH commands, e.g.:
alias cdu='cd repo/uieip'
alias hist='history 20'
Method 1
- If you are using Command Prompt (cmd.exe), then you can set up aliases using DOSKEY.
- The simplest way to achieve this is as follows:
- Create a batch file, e.g.,
alias.bat. - Write your aliases using the syntax from this example:
doskey ga=git add. - To use these shortcuts in a Command Prompt session, open your batch file by navigating to its directory and running:
alias.bat.
- Create a batch file, e.g.,
- These shortcuts will work only for the current session.
Method 2 (permanent and automatic shortcuts)
- To create permanent aliases using DOSKEY and to make them available automatically when opening a Command Prompt session, see this link.
- Unfortunately, this method is unavailable inside the Chase firewall.
Starting at gnlab
- Goals, Norms, Rhythms, and Professional Dev't
- Analyst, not a coder and common challenges
- For UChicago Undergraduates
Advice for doing research
Code and computation
- IT setup guide
- Code style guide
- RCC guide
- IT platform guide
- Logging: Best Practices
- Consumption model guide
- Simulation techniques
- Bootstrap
- Using Box for Large File Storage
Github and git
- Task and Code Management Guide
- Pull Requests and Code Reviews
- git hooks guide
- Shortcuts for git (and other) commands
Exhibits
Producing papers
- Writing style guide
- Replication kit guide
- Paper production guide
- Citation guide
- AEA Submission guide
- Overleaf guide
Professional development and career rhythms
- Professional Development and PhD Application guide
- Offboarding
- Exit interview questions
- Questions you might get asked at an interview
- Questions to ask at a PhD admissions visit
- Recommendation letters (non‐PhD)
Miscellaneous
Legacy