使用git打开文件的命令 [英] Command to open file with git

查看:58
本文介绍了使用git打开文件的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 我在git 中将sublime文本作为默认编辑器(并且有效)
  • git config --edit 以崇高的文字(很棒)打开配置文件
  • I have sublime text as the default editor in git (and it works)
  • git config --edit opens the config file in sublime text (Awesome)

我的问题:

从项目目录中打开 index.html style.css 的命令是什么?

What is the command to open say index.html or style.css from inside the project directory?

基本上,当我在开发项目时,我希望能够从git打开文件.这该怎么做.每个教程似乎都经过合并,克隆和提交,是的,我们都知道这些,以及如何执行此简单命令.还是在git中无法实现?

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?

  • windows 7
  • msysgit版本1.8.0

我了解git不是启动器,并且严格用于版本控制.只想知道我手边的工具有哪些选择.

当我提交一个项目并意识到我需要对已经关闭的css文件进行小的编辑时出现了问题,并且想知道自从我打开它以来是否可以从git内部编辑该文件.

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

推荐答案

Git与您在项目中打开/编辑文件的方式无关.在git中配置编辑器只是为了使需要编辑器的git内部事物(例如,提交消息)可以使用您喜欢的编辑器.

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.

如果您只想从命令行(cmd.exe)打开文件,就像在Windows资源管理器中双击文件一样,我想您可以使用 start< filename> .

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>.

这篇关于使用git打开文件的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆