git config --edit
opens the config file in sublime text (Awesome)My Question:
What is the command to open say index.html
or style.css
from inside the project directory?
Basically when I'm working on a project I would like to be able to open a file from git. How to do this. Every tutorial seems to go over merge, clone, commit yes we all know these, how to do this simple command. Or is this not possible from within git?
I understand git is not a launcher and is strictly for version control. Just want to know what options I have with the tools at hand.
The question came up while i was commiting a project and realized i needed to make a small edit to a css file i had closed already and was wondering if i could open to edit the file from within git since i had it up.
Seems this is not possible (not the end of the world) I just like to understand all of my options with the tools i use is all
Step 1: Go to Github repository and in code section copy the URL. Step 2: In the Command prompt, add the URL for your repository where your local repository will be pushed. Step 3: Push the changes in your local repository to GitHub. Here the files have been pushed to the master branch of your repository.
To open any file from the command line with the default application, just type open followed by the filename/path.
Using Windows Explorer, navigate to any directory you want, type "cmd" in the address bar it will open Windows command prompt in that directory. Along the same lines, if you have the git directory in your path, you can type "git-bash" in the address bar and a Git Shell will open in that directory.
Git has nothing to do with how you open/edit files in your project. Configuring the editor in git is only so that git internal things that require an editor (commit messages for example) can use your preferred editor.
If you just want to open files from the command line (cmd.exe) as if they were double clicked in the windows explorer, I think you can use start <filename>
.
I was able to do this by using this command:
notepad .gitignore
And it would open the .gitignore file in Notepad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With