我想使用版本控制,但由于安全原因,我正在使用的服务器无法访问互联网:我只能移动 USB 闪存驱动器上的文件。我还能在这个设置中使用 Git 吗?我可以创建可以应用于 Git 存储库的小补丁吗?
我一直在一个新分支上开发一个新功能,同时在我的主分支上做了很多更改。
是否可以将 master 分支合并到我的新分支中以使其保持最新状态,以便在新功能完成后我不会有太多合并冲突?
我正在尝试从命令行将项目推送到远程存储库。
从我的本地目录中,我点击了:
$ git push
Run Code Online (Sandbox Code Playgroud)
并获得以下错误:
远程:username1/repo.git 的权限被拒绝给 username2。
致命:无法访问“ https://github.com/username1/repo.git/ ”:
请求的 URL 返回错误:403
username1
我的 github 帐户用户名在哪里托管我想要推送到的存储库,并且username2
是我曾经在这台机器上使用的旧帐户。
我在 Macbook Air 上使用 OS X Yosemite (v10.10.5)。我更喜欢使用https而不是ssh。
如何更新到username1
以便我可以成功推送到我的遥控器?
编辑:明确地说,我不是在谈论简单地编辑config user
对象,例如,
$ git config --global user.name "Billy Everyteen"
$ git config --global user.email "billyeveryteen@example.com"
Run Code Online (Sandbox Code Playgroud)
它们与身份验证无关。我的问题涉及写入远程存储库所需的用户身份验证。
我正在使用 git bash 并使用 ssh-keygen 设置 ssh 密钥,每次我用 repo git 做某事时都会问我/c/Users/jankiewj/.ssh/id_rsa
. 有没有办法禁用该密码。
编辑: 我编辑了原始标题(删除了 Windows),因为我刚刚在我的工作笔记本电脑上使用了全新安装的 Ubuntu,当 ssh 密钥有密码时,它总是要求它,解决这个问题的解决方案是一样的。这可能在同样是 Unix 的 MacOSX 上工作相同,并使用相同的基本工具。
我在 Windows 7 上使用 git-bash。我想查看当前目录的树。然而:
jcollum@DEVELOPER01 ~/Dev/express_coffee
$ tree .
sh.exe": tree: command not found
Run Code Online (Sandbox Code Playgroud)
好的,所以我没有 tree 命令。我该如何安装?我找到了一篇文章,但它是针对 Mac 的。
我的 Apple MacBook pro M1 2020 自动更新到Monterey 12.6
最近。更新后,我必须同意 Xcode 协议/许可证。之后,我发现两者python
都git
不再正常工作。我收到一个弹出窗口:The \xe2\x80\x9cgit\xe2\x80\x9d command requires the command line developer tools.
但是在我安装该工具后,弹出窗口又回来并要求我递归安装该工具。有什么建议来解决这个问题吗?
当我运行该git
命令时,出现以下错误消息:
2022-09-15 16:35:42.216 xcodebuild[5621:29269] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn\xe2\x80\x99t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)\n Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'\n …
Run Code Online (Sandbox Code Playgroud) 我有一个名为 my-project 的文件夹,其中我已经完成了git init、git commit -a等。
现在我想将它推送到远程服务器上 /mnt/foo/bar 的空文件夹中。
我怎样才能做到这一点?
我确实尝试过,根据我读过的内容:
cd my-project
git remote add origin ssh://user@host/mnt/foo/bar/my-project.git
git push origin master
Run Code Online (Sandbox Code Playgroud)
这似乎不正确(我认为源会在目的地之前出现)并且失败了:
fatal: '/mnt/boxee/git/midwinter-physiotherapy.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
我希望这样工作,这样我就不必每次都访问远程主机并手动初始化 Git 存储库……我必须这样做吗?我真的走对了路线吗?
谢谢。
我有两个分支,其中包含以下文件:
分支a:
file_a
file_b
file_c
Run Code Online (Sandbox Code Playgroud)
分行b:
file_a
file_d
file_e
Run Code Online (Sandbox Code Playgroud)
我想合并它们,以便我从a和b 中获取两个文件(通常应该合并两者中存在的文件)!那有可能吗?
在SourceTree的分支视图中,我看到了所有提交。我想过滤提交以仅显示我/某人提交的提交。我怎样才能做到这一点?谢谢。
为了在 git 中比较二进制文件,我假设我需要设置一个 difftool。
什么 difftools 工作?怎么把参数放进去?