相关疑难解决方法(0)

在GitHub上使用https://时有没有办法跳过密码输入?

我最近切换到将我的存储库同步到GitHub上的https://(由于防火墙问题),并且每次都要求输入密码.过去,我有一个SSH证书,这就足够了.在我的情况下是否有办法绕过密码(使用http/https)?

git authentication github git-push git-config

1806
推荐指数
19
解决办法
94万
查看次数

从GitHub存储个人访问令牌的位置?

在GitHub中生成个人访问令牌后,是否有必要将其存储在本地的某个位置?

如果是,是否有任何可以存储的首选方式?

git github access-token

30
推荐指数
8
解决办法
2万
查看次数

将Git凭证助手与gnome-keyring一起用作Sudo时出错

我正在寻找一种方法来安全地存储凭证,同时连接到使用SSL的Git服务器.我在@james-ward中遇到了这个建议(我编辑的只是我更新了我们的"系统"配置,而不是Git的"全局"配置(/sf/answers/1016985231/)

sudo apt-get install libgnome-keyring-dev
cd /usr/share/doc/git/contrib/credential/gnome-keyring
sudo make
git config --system credential.helper /usr/share/doc/git/contrib/credential/gnome-keyring/git-credential-gnome-keyring
Run Code Online (Sandbox Code Playgroud)

然后我就可以跑了

git clone https://ipaddress/git/repo.git
Run Code Online (Sandbox Code Playgroud)

并且凭证助手将存储我的凭据,但是当我运行以下内容时:

sudo git clone https://ipaddress/git/repo.git testfolder
Run Code Online (Sandbox Code Playgroud)

它给我以下错误

** (process:3713): CRITICAL **: Error communicating with gnome-keyring-daemon
Run Code Online (Sandbox Code Playgroud)

我有时需要运行sudo git clone,因为有时我需要创建克隆的目录需要它.任何帮助,将不胜感激.

我正在使用的版本: - git版本1.9.1 - Ubuntu Server 14.0.4

先感谢您!-Richard O.

linux git ubuntu gnome-keyring-daemon

22
推荐指数
3
解决办法
2万
查看次数

如何在Windows中的Git Bash控制台中注销?

我在Windows上使用Git,版本为2.9.2.windows.1.

我在一个存储库项目上工作,当我进行推送时,它要求我输入我的Github用户名和密码.我输入了我的Github用户名和密码来更新项目.

在我的下一次推送中,它不再要求我的用户名和密码.我对该项目的所有修改都已更新.

看起来我的用户名和密码已"保存".我怎么"解开"他们?

我该如何退出?

我试过了

git config --global --unset user.name
git config --global --unset user.email
git config --global --unset credential.helper
Run Code Online (Sandbox Code Playgroud)

但他们不会让我退出.

我想清除我的登录信息,以便下次推送时,它再次要求我输入我的用户名和密码.


我找到了我的解决方案(感谢VonC):

转到:控制面板 - >用户帐户 - >管理您的凭据 - > Windows凭据 - >在Generic Credentials下,有一些与Github相关的凭据,单击它们并单击"删除".

它签了我,所以下次我推,它要求我输入我的用户名和密码.

git passwords github username

22
推荐指数
4
解决办法
5万
查看次数

配置Git客户端,如GitHub for Windows,不要求身份验证

我已经安装了GitHub for Windows和GitExtensions,并且在我的路径中有多个版本的git.exe.

在此输入图像描述

C:\Users\Rajat\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\cmd\git.exe
C:\Users\Rajat\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\bin\git.exe
E:\cygwin\bin\git.exe
C:\Program Files (x86)\Git\cmd\git.exe
C:\Program Files (x86)\Git\bin\git.exe
Run Code Online (Sandbox Code Playgroud)

现在,当我git push origin master使用最后三个中git.exe的任何一个时,它会询问我的用户名.但Portable Git不会要求用户名.请参阅以下屏幕截图:

在此输入图像描述

心形的角色只是^C如此无视.

在这种情况下如何处理身份验证?最后,我希望最后三个Gits不要求授权.怎么可能?

我在GitHub的Git中找到了两个额外的文件,但我怀疑它们是否重要:

在此输入图像描述

git github github-for-windows

18
推荐指数
3
解决办法
3万
查看次数

如何输入密码到git pull命令?

我已经为Windows和Linux编写了脚本,基本上建立了一个新的用户工作区,其中包含来自我们服务器的所有git存储库.

我希望用户输入我们服务器的密码一次,将其存储在本地变量中,将该变量传递给每个git pull命令,然后擦除密码变量并退出.

如何在git pull命令请求时输入密码?Windows批处理文件和Linux shell脚本都有.

以下是Linux脚本中的代码:

#!/bin/bash

echo "Enter password: "
read pswd
clear #No screen peaking

#This is repeated for each repo
location=folderName
mkdir $location
cd $location
git init
git remote add origin git@<server>:$location.git
git pull origin master 
#Above prompts for password & is where I want to automatically input $pswd
Run Code Online (Sandbox Code Playgroud)

我已尝试在SO和其他地方推荐的各种东西,例如管道,从.txt文件读取等.我宁愿不需要比普通的旧Windows cmd和Linux终端命令更多的东西.由于此脚本仅用于设置目的,因此我无需使用ssh代理等安全存储密码.

我正在运行Windows 7和Ubuntu 12.10,但是这个脚本用于设置新用户,因此理想情况下它适用于大多数发行版.

linux windows git batch-file

18
推荐指数
2
解决办法
4万
查看次数

使用Git存储密码有多安全?

我在我的工作场所使用Git,公司政策不允许我以不安全的方式存储密码.有没有比使用git config credential.helper store存储密码到Git服务器更好的选择?

PS无法使用密钥身份验证,因为我们的服务器不允许这样做.

linux git security macos

18
推荐指数
1
解决办法
2万
查看次数

使用RStudio的Git工具时出错

当试图从RStudio推送到GitHub时,我收到以下错误.

error: unable to read askpass response from 'rpostback-askpass'
fatal: could not read Username for 'https://github.com':
       No such device or address
Run Code Online (Sandbox Code Playgroud)

RStudio的起源是

https://github.com/rmscriven/other.git
Run Code Online (Sandbox Code Playgroud)

什么时候它应该是

https://github.com/rmscriven/saber.git
Run Code Online (Sandbox Code Playgroud)

RStudio不允许我更改版本控制系统的来源.这是它显示的内容:

在此输入图像描述

是否可以从RStudio更改我的GitHub原始URL?

git r rstudio

11
推荐指数
1
解决办法
4503
查看次数

使用 libsecret 存储 git 凭据:未找到 org.freedesktop.Secret.Collection 接口

我正在尝试在 Ubuntu 20.04 上使用 libsecret 存储我的 git 凭据。我按照以下说明进行操作:

sudo apt-get install libsecret-1-0 libsecret-1-dev gnome-keyring
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
    
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
Run Code Online (Sandbox Code Playgroud)

我还导出了DBUS_SESSION_BUS_ADDRESSexport $(dbus-launch)

但是,登录后,当 libsecret 尝试存储凭据时,出现以下错误。似乎某处缺少一个类,但我还没有找到从哪里获取它的答案。

store failed: No such interface ?org.freedesktop.Secret.Collection? on object at path /org/freedesktop/secrets/collection/login
Run Code Online (Sandbox Code Playgroud)

有人知道我错过了什么吗?

git credentials

7
推荐指数
1
解决办法
5826
查看次数

无法连接到存储库:命令“git ls-remote -h

我已经安装jenkinscentos7 server尝试构建一个maven版本。创建了一个新的 Maven 构建作业,SCM我试图从中提取代码github,但它向我显示了一个错误,例如...

Failed to connect to repository : Command "git ls-remote -h https://github.com/example.git HEAD" returned status code 128: stdout:  stderr: remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/example.git/'
Run Code Online (Sandbox Code Playgroud)

我还为SSH我的github. 我不知道如何解决这个问题。任何人都可以帮助我。提前致谢。

jenkins github-for-windows centos7

5
推荐指数
1
解决办法
2万
查看次数

使用 git 子模块创建多个远程分支

我第一次使用 git 子模块。努力理解如何全面创建分支并将它们添加到所有远程存储库中。

目前我的文件结构类似于以下内容:

-parent_repo
  |
  |_ submodule_1
  |_ submodule_2
  |_ submodule_3
  |_ submodule_4
  |_ submodule_5
  |_ submodule_6
  |_ submodule_7
Run Code Online (Sandbox Code Playgroud)

如果我在父仓库上创建一个分支:

(master) $ git checkout -b feature/my_feature
(feature/my_feature) $ git commit -m "created my_feature"
(feature/my_feature) $ git push -u origin feature/my_feature
Run Code Online (Sandbox Code Playgroud)

我想在包括父模块在内的所有子模块中创建一个分支。之后,所有分支都被远程推送到每个子模块及其受尊重的存储库。

尝试了以下步骤:

$ git submodule foreach -b branch_name
$ git push --recurse-submodules=on-demand
$ git submodule foreach "(git checkout branch_name; git pull)&"
Run Code Online (Sandbox Code Playgroud)

..只是失败了。找不到第一个命令。

..如果我这样做:

$ git config -f .gitmodules submodule.submodule_1.branch branch_name
$ git submodule update --remote
Run Code Online (Sandbox Code Playgroud)

git 返回:

fatal: Needed …
Run Code Online (Sandbox Code Playgroud)

git version-control github git-submodules

2
推荐指数
1
解决办法
2797
查看次数