当我将更改连同通常的统计信息一起推送到 Bitbucket 服务器时,服务器会以“remote:”开头的几行进行响应。其中一行包含一个 URL,用于减少推送分支的差异并创建拉取请求。我目前突出显示 URL 并将其复制/粘贴到浏览器窗口中以创建我的拉取请求,但我希望加快该过程。有没有办法提取 URL 并将其传递给“clip”以将其作为 git 别名的一部分保存到剪贴板?
我还考虑过尝试使用当前分支名称和远程 URL 的组合来重新创建 URL,但是远程 URL 和拉取请求 URL 之间存在一些差异,因此提取 URL 似乎比重新创建更容易创造它。
Counting objects: 47, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (47/47), 12.81 KiB | 0 bytes/s, done.
Total 47 (delta 40), reused 3 (delta 2)
remote:
remote: Create pull request for feature/somefeature:
remote: https://code.ourbitbucketserver.com/projects/myteam/repos/somerepo/compare/commits?sourceBranch=refs/heads/feature/somefeature
remote:
To https://code.ourbitbucketserver.com/scm/myteam/somerepo.git
* [new branch] feature/somefeature -> feature/somefeature
Branch feature/somefeature set up to track remote branch …Run Code Online (Sandbox Code Playgroud) Git 2.10 引入了 git Push 选项( git push -o "my string")。
许多命令行选项都是可配置的,我想知道是否也可以这样做。我无法在git-config中找到它,但也许我忽略了它。
那么,是否可以添加一组(一组)默认推送选项,以...
git push -o "r=joh.doe"
Run Code Online (Sandbox Code Playgroud)
...运行时的默认值...
git push
Run Code Online (Sandbox Code Playgroud)
?
上下文:
我将其与 Gerrit 一起使用,直接将更改分配给审阅者(参考文档- 使用兼容语法<push-ref>%my_string)。当上传许多更改并结对审查彼此的代码时,如果我可以在推送时将该人添加为审查者,那将会很有用。
我正在尝试推送我已经在 GitHub 中完成的提交。
但我不能。当我按下push(或者输入git pushcmd)时,出现以下错误:
Enumerating objects: 78, done.
Counting objects: 100% (78/78), done.
Delta compression using up to 4 threads
Compressing objects: 100% (37/37), done.
error: RPC failed; curl 55 Send failure: Connection was aborted
fatal: the remote end hung up unexpectedly
Writing objects: 100% (48/48), 11.72 MiB | 339.00 KiB/s, done.
Total 48 (delta 23), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
Run Code Online (Sandbox Code Playgroud)
这是一个用VS编写的C++程序。我已经在同一个仓库和同一个项目中提交并推送了更多的东西。仓库是https://github.com/Tupiet/learncpp- tutorial
我已经搜索了一段时间,发现人们说要这样做:git config …
git push --force如果我单独做一个项目,使用会有危险吗?我知道与团队合作时存在危险。但如果我独自一人怎么办?
我正在尝试在 gitlab-runner 中创建一个自动管道,它将应用最新git push. 它正在获取推送中的最新提交(使用 gitlab-runner 中的 $CI_COMMIT_SHA 变量)。但是,如果一次推送有多个提交,它会忽略较旧的提交。因此,所有更改都不会应用到应用程序中。
我有以下疑问:
git cherry可以给我未推送的提交列表。有没有办法,我可以通过变量将信息传递给 gitlab-runner ?提前致谢
我有一个存储库,其子模块位于 /modules 目录中。
我现在想强制推送整个仓库内容,包括。/modules 的内容到另一个存储库(用于部署)。
但是,当我在子模块中进行更改时,目标存储库的内容似乎没有更新。这是我运行来推送内容的:
- git pull
- git submodule update --init --recursive
- git push -f --recurse-submodules=on-demand https://example.com/deployment.git master
Run Code Online (Sandbox Code Playgroud) 在 Visual Studio 代码中
我为此花费了更多时间,我正在尝试将来自第一个帐户 github 的已删除项目推送到 新的另一个帐户中的现有存储库中,但我收到如下错误:
$ git push -u origin main
remote: Permission to username/project_name.git denied to first_account_username.
fatal: unable to access 'https://github.com/user_name/project_name.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)
我尝试使用这些命令行将现有存储库推送到新帐户中,请让我知道我错过了什么?
git remote add origin https://github.com/user_name/project_name.git
git branch -M main
git push -u origin main
Run Code Online (Sandbox Code Playgroud) 我正在尝试将我的更改推送到我的NAS上的回购.它以我不理解的方式失败了.
该文档指出默认情况下push仅适用于快进更新.很公平.所以我做了一个git pull(我的遥控器叫rubix):
D:\RoboCup\Dev\TinMan>git pull rubix master From ssh://rubix/volume1/git/TinMan * branch master -> FETCH_HEAD Already up-to-date.
一切顺利.我们试着推......
D:\RoboCup\Dev\TinMan>git push rubix master To ssh://dnoakes@rubix/volume1/git/TinMan ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'ssh://dnoakes@rubix/volume1/git/TinMan' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
我已经阅读了文档,git push但此时我无法理解为什么我会看到这个问题. …
我使用以下命令删除了本地存储库中一些无法访问且悬空的提交
git fsck --unreachable --dangling --no-reflogs
git reflog expire --expire=now --all
git gc --prune=now
Run Code Online (Sandbox Code Playgroud)
但是我发现删除的提交仍然可以在原始服务器上使用(确切地说是GitHub)。
我试过了,git push --force但是它没有将更改同步到原点。如何强制将更改同步到原点(将无法访问/悬垂的提交也从远程删除)?
这是一个类似的问题,没有答案:
当我尝试将TortoiseGit推送到Bitbucket作为初始源代码时,出现错误:
远程名称不能为空。
我已经使用了TortoiseGit很多时间,即使我从未输入任何远程名称,也从未遇到此错误的任何问题。仅当我尝试推动时才会发生。我可以保证。
如何解决呢?
git-push ×10
git ×9
bitbucket ×2
github ×2
dvcs ×1
gerrit ×1
git-cherry ×1
git-commit ×1
git-config ×1
git-reflog ×1
git-remote ×1
pull-request ×1
push ×1
runner ×1
tortoisegit ×1
windows ×1