git URL中的“.git”是什么意思?(What does the “.git” mean in a git URL?)
我在foo中设置了一个git repo
cd mkdir foo cd foo git init
现在我想远程引用它
git clone git+ssh://me@somemachine/home/me/foo.git fatal: git remote error '/home/me/foo.git' does not appear to be a git repository
所以我采取了,并且它工作。 但几乎我看到的每个例子都有“.git”。 那个“.git”是什么意思?
另外,ssh:// ...和git + ssh:// ...之间有什么区别(包括意义和实际意义)
I setup a git repo in foo
cd mkdir foo cd foo git init
Now I want to reference that remotely
git clone git+ssh://me@somemachine/home/me/foo.git fatal: git remote error '/home/me/foo.git' does not appear to be a git repository
So I take .git off and it works. But nearly every example I see has ".git" at the end. What does that ".git" mean?
Also, what's the difference between ssh://... and git+ssh://... (in both meaning and practical terms)
原文:https://stackoverflow.com/questions/8686691
最满意答案
只有当您有一些实际上可以手动执行的低级别资源约束时,才能自行显式关闭资源。
需要考虑的情况:
- 通过惰性IO获得的资源:必须使用GC来释放资源
- 严格IO:读取输入后可手动关闭; 或使用包围组合器(例如
finally
或bracket
)- 增量IO(管道,迭代):让框架为你关闭它。
It is better to explicitly close resources yourself, only when you have some low level resource constraint that you can actually enforce manually.
The cases to consider:
- resources aquired via lazy IO: must use the GC to free the resource
- strict IO: can close manually once input is read; or use a bracketing combinator (e.g.
finally
orbracket
)- incremental IO (conduits, iteratees): let the framework close it for you.
相关问答
更多-
只有当您有一些实际上可以手动执行的低级别资源约束时,才能自行显式关闭资源。 需要考虑的情况: 通过惰性IO获得的资源:必须使用GC来释放资源 严格IO:读取输入后可手动关闭; 或使用包围组合器(例如finally或bracket ) 增量IO(管道,迭代):让框架为你关闭它。 It is better to explicitly close resources yourself, only when you have some low level resource constraint that you c ...
-
即使没有-threaded ,Haskell运行时也会有多个“绿色线程”协同运行。 您需要使用Control.Concurrent来限制对文件的访问,因为您不能一次写入多个线程。 最简单的方法是在Server有一个MVar () ,并在打开文件之前让每个请求从MVar “取”出单元,然后在完成文件操作后将其放回原处。 即使写入文件失败,也可以使用bracket来确保锁被释放。 比如类似的东西 import Control.Concurrent import Control.Exception (bracke ...
-
好的,回答我的问题......我已经扩展了ns-tracker并提交了拉取请求。 这不像我预期的那么简陋,实际上是合理合理的。 我的分叉位于: https : //github.com/hutch/ns-tracker 包括ns-tracker有许多变化。 特别是对于我的问题,它支持使用clojure / core使用的load / in-ns。 您可以使用leiningen'checkouts'机制在项目中使用此fork。 Okay, answering my question... I have ext ...
-
当他们的手柄超出范围时,Julia会自动关闭文件吗?(Does Julia automatically close files when their handles go out of scope?)[2023-10-19]
是的,这是自动完成的。 但是,当对象超出范围时,终结器不会被调用,而是在垃圾回收确定没有对该对象的更多引用时。 但是,这可能不会发生在您期望或想要的时候。 要在退出当前作用域时自动关闭文件句柄,可以使用open-do-block结构: open("file.txt") do fh # do stuff with open file handle `fh` end # `fh` is closed here Yes, that is done automatically. However, finali ... -
使用文件租约和/或fcntl()锁(记录锁)在多线程应用程序中通过fork()和exec*()打开文件描述符处理是很冒险的。 一般来说, O_CLOEXEC / fcntl(fd, F_SETFD, FD_CLOEXEC)选项比明确关闭描述符更可取,因为明确关闭描述符有一些不良副作用。 特别是,如果您有关于描述符的租约,关闭子进程中的描述符将释放租约。 请注意,在Linux中, fcntl()锁不会通过fork()继承; 请参阅man 2 fork中的说明。 posix_spawn()在C库中实现,文件操作 ...
-
这可能是该进程的当前目录。 如果您使用安装目录启动记事本,因为它的当前目录将显示相同的句柄。 然后,当您在记事本中使用文件打开对话框导航到其他目录时,句柄将消失。 使用Environment.CurrentDirectory更改目录或使用更好的当前目录创建子目录。 This is probably the current directory of the process. If you start notepad with your install directory as it's current dir ...
-
我如何使用Perl将相同的文本写入两个单独的文件句柄?(How can I write the same text to two separate file handles using Perl?)[2023-09-02]
使用IO :: Tee 。 从文档的例子: use IO::Tee; $tee = IO::Tee->new($handle1, $handle2); print $tee "foo", "bar"; Use IO::Tee. From the documentation's example: use IO::Tee; $tee = IO::Tee->new($handle1, $handle2); print $tee "foo", "bar"; -
不幸的是,加载到默认AppDomain中的程序集将不会被卸载,直到应用程序退出。 但是,您可以创建AppDomain并在创建的AppDomain中加载程序集。 当创建的AppDomain被卸载时,在创建的AppDomain中加载的程序集将被卸载。 Unfortunately, assemblies loaded into a default AppDomain will not be unloaded until the application exits. However, you can create ...
-
我假设你实际上使用的是taglib-ruby ,而不是旧的ruby-taglib 。 如果你正在使用taglib-ruby,FileRef(和其他:: File类)从版本0.3.0开始就有一个显式的close方法,请参阅API文档 。 更新:从0.4.0开始,更好的解决方案是使用open class方法,该方法在块运行后接受一个块并自动处理关闭。 请参阅open文档 。 一个例子: TagLib::FileRef.open(file_name) do |file| tag = file.tag # ...
-
通过在同一对象中实现上下文协议和迭代器协议 ,您可以编写如下所示的相当漂亮的代码: with cat("/etc/passwd") as lines: for line in lines: if "mail" in line: print line.strip() break 这是一个样例实现,在Linux机器上用Python 2.5进行测试。 它读取/etc/passwd的行,直到找到用户audio ,然后停止: from __fu ...