【问题标题】:Git commands on IPython notebookIPython 笔记本上的 Git 命令
【发布时间】:2015-07-24 13:54:36
【问题描述】:

我正在尝试在 ipython notebook 中执行 git 命令。我已经为 github 帐户设置了所有 ssh 密钥,如果我在终端上键入此命令,我可以在没有密码的情况下成功使用 git 命令。但是,当我使用 bash 命令模式在 ipython 笔记本上键入此内容时,它会询问我的密码。由于输出是静态的,我无处输入密码。我不明白为什么会这样,因为我虽然 ipython notebook 只是在终端中执行 bash 命令。

In [*]:!git push
Enter passphrase for key '~/.ssh/id_rsa': 

有人知道我为什么会看到这种差异吗?

谢谢。

【问题讨论】:

  • 我认为这些命令是使用sh 运行的,可能是bash 或更简单的POSIX shell,具体取决于您的系统。在我的 Ubuntu/Debian 系统上,sh != bash。这可能会导致不同的环境变量等。

标签: git github ipython ipython-notebook ssh-keys


【解决方案1】:

我敢打赌,这是因为您的 .bash_profile 和您的 .bashrc 文件之间存在差异。

bash作为登录shell运行时,它运行.bash_profile,而不是运行.bashrc,所以如果它们不同,你会得到不同的结果。

我个人的.bashrc 文件只包含source ~/.bash_profile

【讨论】:

    猜你喜欢
    • 2017-08-19
    • 1970-01-01
    • 2018-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多