当您在某个Git目录中工作时,如何在某些Git存储库中获取Git存储库名称?有没有Git命令?
# I did check out bar repository and working in somewhere
# under bar directory at this moment such as below.
$ git clone git://github.com/foo/bar.git
$ cd bar/baz/qux/quux/corge/grault # and I am working in here!
$ git xxx # <- ???
bar
Run Code Online (Sandbox Code Playgroud) 我现在正在使用Ruby on Rails 开发Web API.当Rails应用程序收到没有任何csrf令牌的POST请求时,将发生以下错误消息.因为该应用没有视图.
WARNING: Can't verify CSRF token authenticity
Run Code Online (Sandbox Code Playgroud)
所以我的问题是如何在这种情况下安全地逃避csrf令牌检查?
非常感谢你提前.
首先让我举一个例子.
在shell(1)中,我执行了以下命令.
$ ping google.com
PING google.com (74.125.235.164) 56(84) bytes of data.
64 bytes from nrt19s12-in-f4.1e100.net (74.125.235.164): icmp_seq=1 ttl=54 time=2.85 ms
64 bytes from nrt19s12-in-f4.1e100.net (74.125.235.164): icmp_seq=2 ttl=54 time=3.42 ms
Run Code Online (Sandbox Code Playgroud)
然后,打开另一个shell(2)并查看历史记录.
$ history
.
.
.
8720 exit
8721 clear
8722 history
Run Code Online (Sandbox Code Playgroud)
在这种情况下,shell无法查看shell(1)执行的历史记录,但我想查看每个shell中的所有bash历史记录.
所以我的问题是如何才能看到所有的bash历史?有谁知道如何破解?
非常感谢你提前!
我有一个UserType和一个可用的,可以是一个Writer或帐户.
对于GraphQL,我想也许我可以像这样使用UserableUnion:
UserableUnion = GraphQL::UnionType.define do
name "Userable"
description "Account or Writer object"
possible_types [WriterType, AccountType]
end
Run Code Online (Sandbox Code Playgroud)
然后像这样定义我的UserType:
UserType = GraphQL::ObjectType.define do
name "User"
description "A user object"
field :id, !types.ID
field :userable, UserableUnion
end
Run Code Online (Sandbox Code Playgroud)
但我明白了 schema contains Interfaces or Unions, so you must define a 'resolve_type (obj, ctx) -> { ... }' function
我试过在多个地方放置一个resolve_type,但我似乎无法弄清楚这一点?
现在有人如何实现这个?
这是一个.bashrc问题.我想"export FOO=bar"在特定的目录中设置.bashrc .rvmrc.
我在下面试过.
$ touch ~/foo/.bashrc
$ echo 'export RAILS_ENV=development' >> ~/foo/.bashrc
$ cd foo/
$ env|grep RAILS_ENV
Run Code Online (Sandbox Code Playgroud)
但RAILS_ENV在这种情况下不得设置任何东西.
如果我设置.rvmrc而不是.bashrc,它会通过!但这是更好的设置方式,.bashrc因为我不需要安装rvm环境.
有解决方案吗
当我这样做时,我收到了以下警告brew cleanup。我该如何修复它们?
$ brew cleanup
Warning: Skipping ant: most recent version 1.9.7 not installed
Warning: Skipping atk: most recent version 2.20.0 not installed
...
(continued)
Run Code Online (Sandbox Code Playgroud) 当我使用最新版本jekyll并启动其服务器时,下面将显示某些警告。
$ jekyll serve
Configuration file: /Users/ishida/git/gipcompany.github.io/_config.yml
Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.
Run Code Online (Sandbox Code Playgroud)
我想以下内容gems应替换为plugins,然后警告不会出现,但是我不确定我的猜测是正确的,因为我找不到任何官方文档。我的猜测是正确的吗?
$ cat _config.yml
(omit)
gems:
- jekyll-feed
Run Code Online (Sandbox Code Playgroud) 我想安装screen,但接下来我该怎么做?
$ brew search screen
imgur-screenshot screen screenfetch screenresolution
caskroom/drivers/casio-screen-receiver caskroom/cask/screen-blacker caskroom/cask/show-my-screen caskroom/cask/syphon-virtual-screen
If you meant "screen" specifically:
It was migrated from homebrew/dupes to homebrew/core.
Run Code Online (Sandbox Code Playgroud) 我的个人存储库有一些存储库作为子模块.以及以下命令
$ git submodule foreach git pull origin master
Run Code Online (Sandbox Code Playgroud)
在进入ruby存储库后面对以下结果,因为ruby存储库似乎没有主分支并且"git pull"停止了.
Entering 'rails'
From git://github.com/rails/rails
* branch master -> FETCH_HEAD
Already up-to-date.
Entering 'roo'
From git://github.com/hmcgowan/roo
* branch master -> FETCH_HEAD
Already up-to-date.
Entering 'ruby'
fatal: Couldn't find remote ref master
Stopping at 'ruby'; script returned non-zero status.
Run Code Online (Sandbox Code Playgroud)
所以我的问题是what should I do to git pull for all of submodules only by git command?我应该为此制作一个剧本吗?我希望git提供的一个命令行可以实现这一点.
什么时候执行下面的命令?另外,你能解释一下它给我们带来了什么吗?
$ bundle install --binstubs
Run Code Online (Sandbox Code Playgroud)