##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/.git
##Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:alexpchin/.git
Win + Alt + P{bash} with the following settings:
/icon "%CMDER_ROOT%\cmder.exe" /icon "C:\Program Files (x86)\Git\etc\git.ico""C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%| export PS1="\e[44mogem@local:\e[m \w \[$txtcyn\]\$git_branch\[$txtrst\] \n$ " | |
| export CLICOLOR=1 | |
| export LSCOLORS=GxFxCxDxBxegedabagaced | |
| export GITAWAREPROMPT=~/.bash/git-aware-prompt | |
| export PATH=/opt/local/bin:/opt/local/sbin:$PATH | |
| export PATH=$PATH:~/.scripts/ | |
| export PATH=$PATH:/usr/local/bin | |
| export PATH="$HOME/.node/bin:$PATH" | |
| source $GITAWAREPROMPT/main.sh |
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc| ; | |
| ; AutoHotkey Version: 1.1 | |
| ; Language: English | |
| ; Platform: Win9x/NT | |
| ; Author: Yibo | |
| ; | |
| ; Script Function: | |
| ; Define the shortcut Ctrl + Alt + T for launching Git bash in current folder in Windows Explorer | |
| ; |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!
$ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
| { | |
| "editor.fontFamily": "Ricty Diminished", | |
| "editor.fontSize": 15, | |
| "editor.formatOnType": true, | |
| "editor.formatOnSave": true, | |
| "editor.wordWrap": "on", | |
| "editor.scrollBeyondLastLine": false, | |
| "workbench.startupEditor": "newUntitledFile", | |
| "python.linting.enabledWithoutWorkspace": false, | |
| "typescript.check.npmIsInstalled": false, |
| #!/bin/sh | |
| RED='\033[0;31m' | |
| NC='\033[0m' # No Color | |
| test_results=$(script -q /dev/null pipenv run python -m pytest ./test -v --tb=no) | |
| if [ $? -eq 1 ]; then | |
| printf "${RED}CANNOT COMMIT, PYTEST FAILED\n\nPYTEST RESULTS:\n" | |
| echo "$test_results" | |
| exit 1 | |
| fi |