git config --edit
opens the config file in sublime text (Awesome)
Brenton Alker above said 'start ' works -- I'll add a caveat to that: that works for all files that are already associated with sublime-text (as he says, it works as if they were double clicked in windows explorer).
But if, for example, you wanted to open the .gitignore file from your shell into sublime_text, and .gitignore is not associated with sublime_text, here's what I did:
I edited my PATH environment variable to contain the Sublime Text folder within program files, the one that holds sublime_text.exe. Now, in my terminal (I use powershell, but it works from any terminal), when I type 'sublime_text .gitignore' the .gitignore from my current directory opens in Sublime!
I tried to make a .bat file called sublime.bat that would work so that I could just type sublime .gitignore, but that didn't work - it opened sublime text but not the file for some reason. I'm content with sublime_text (tab completion simplifies it for me, actually -- simply 'su[tab]' does the trick!
To open a file in git, with windows you will type explorer .
, notice the space between explorer and the dot. On mac you can open it with open .
, and in Linux with nautilus .
, notice the period at the end of each one.
To open a file in Sublime Text,
Here is an example for opening a sample text file in Sublime Text editor
subl <filename>.txt
subl is previously created as an alias name,containing the directory file, using the "echo" command in Git Bash shell.
You can use the git command line as a terminal my dude you just know the commands are bash To create a file
touch file.txt
To open a file
code file.py
atom file.py
start file.py
ect
To open your current folder and everything inside of it in your text editor
code .
To make a folder
mkdir folder1 folder2 folder3
You can make as many as you want at once this works with touch to
I just downloaded Git 2.7.0 and added an alias to the .bashrc for editing files with VS Code:
alias code='/c/Program\ Files\ \(x86\)/Microsoft\ VS\ Code/bin/code.cmd'
Should also work with other Editors...
while you are working in some whatever project and you want to make a minor change you can use git default editor, however you'd probably need a little script that parse the file generated by command below
git config -l
then the variable code.editor
holds the value /Applications/Sublime_Text.app -n -w
which you can open using os.system()