这里的内容remote和branch我的部分.git/config文件.
Run Code Online (Sandbox Code Playgroud)[remote "origin"] url = https://EvanAad@bitbucket.org/EvanAad/bitbucketstationlocations.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master
这些部分内容的含义和目的是什么,特别是fetch和merge子部分?Git如何使用这些信息来指导其运作?
我想将我的 API 配置文件 ( binary.file) 之一添加到 Github 机密 (MY_BINARY_SECRET)。binary.file然后它将在工作流程中再次读取和写入:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install System
run: |
sudo apt-get update
sudo apt-get install -y pip python3.8-venv libcurl4-openssl-dev
- name: Set up configurations
shell: bash
run: |
echo "${{ secrets.MY_BINARY_SECRET }}" > binary.file
python3 .... # the python script will need binary.file to complete authentication
Run Code Online (Sandbox Code Playgroud)
然而,我尝试了很多个小时,用不同的方法将二进制内容复制到 Github Secret,但都失败了。我试过pbcopy,less,cat。有谁知道如何在 github actions 中通过 Github Secret 编写二进制文件?或者更好的解决方案?
谢谢你!
我不小心创建了一个名为的文件:w.我设法通过使用zsh选项卡功能删除它.但我不能从我的git缓存中删除它.
git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: Gemfile
# modified: Gemfile.lock
# new file: config/newrelic.yml
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: :w
#
Run Code Online (Sandbox Code Playgroud)
然后
git rm :w
fatal: pathspec 'w' did not match any files
Run Code Online (Sandbox Code Playgroud) 我想知道如果我只使用 git 命令:
git push
Run Code Online (Sandbox Code Playgroud)
如果我使用
git push origin master
Run Code Online (Sandbox Code Playgroud)
那么,它们之间有什么区别呢?
我正在 gitlab 上工作,并且我有开发人员访问我正在从事的项目的权限。我正在使用 Windows 命令行。
我们已经愉快地将 ArgoCD 与公共存储库一起使用了一段时间,但在尝试将 ArgoCD 连接到私有存储库时遇到了问题。我们有一个Application看起来像这样的:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: example-app
namespace: argocd
spec:
destination:
name: example-cluster
namespace: open-cluster-management-agent
project: ops
source:
path: .
repoURL: ssh://git@github.com/example-org/example-repo.git
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Validate=false
- ApplyOutOfSyncOnly=true
Run Code Online (Sandbox Code Playgroud)
以及相应的密钥,其密钥如下所示:
apiVersion: v1
metadata:
labels:
argocd.argoproj.io/secret-type: repository
name: example-repo
namespace: argocd
type: Opaque
stringData:
sshPrivateKey: |
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
url: ssh://git@github.com/example-org/example-repo.git
kind: Secret
Run Code Online (Sandbox Code Playgroud)
ArgoCD 无法同步此应用程序并显示以下错误:
rpc error: code = Unknown desc = …Run Code Online (Sandbox Code Playgroud) 当我创建 MR 时,我想在 MR(合并请求)命令部分查看声纳结果。
我的主要期望:
我尝试用下面的示例阶段来做到这一点。但是当我将提交推送到源管道时,而源分支存在 MR。我仍然得到双管道。分离管道和源管道正在运行,我不想同时看到两者,而且除了不使用规则配置之外。如何将除部分与规则部分集成。
这是我的 gitlab-ci 阶段:
deploy:
stage: deployment
when: manual
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CUSTOM_VARIABLE == "true" || $CUSTOM_VARIABLE == "true"'
script:
- ....
- ....
except:
- tags
- main
Run Code Online (Sandbox Code Playgroud)
我还尝试了以下规则,如果其中一项符合我的条件,则不要运行另一项。但它仍然触发两条管道。
deploy:
stage: deployment
when: manual
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CUSTOM_VARIABLE == "true"'
when: on_success
- if: '$CI_PIPELINE_SOURCE == "push" && $CUSTOM_VARIABLE == "true"'
when: on_success
script:
- ....
- ....
except: …Run Code Online (Sandbox Code Playgroud) 当我在 VScode 中打开源代码控制面板时,通常我能够看到任何差异,并且在面板底部我可以打开/关闭各种选项卡,例如提交、分支、远程等。对于特定存储库,这些选项卡全部消失。
它应该是这样的:

但是,它们没有显示在这个特定的存储库上。这是它在相关存储库上的外观:
我在项目中使用 gulpfile.js 来下载文件,并且工作正常。
var shell = require('gulp-shell');
gulp.task('folder_xyz', shell.task('curl --output xyz.zip --header "PRIVATE-TOKEN: theyuuin_io2_kj" "https://example.com/api/v4/download?job=xyz"'));
Run Code Online (Sandbox Code Playgroud)
这里一切正常,我可以下载该文件。但是我在 GitLab 中设置了名为download_folder_xyz. 现在我想使用这个环境,想用新变量替换私有令牌,我该download_folder_xyz怎么gulp.task()做?
我正在尝试使用 git hub 工作流程创建我的存储库的 zip 文件。下面是代码:
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set Up MS Build
uses: microsoft/setup-msbuild@v1
- name: Restore dependencies
run: nuget restore Solution.sln
- name: Build Solution
run: msbuild Solution.sln
- name: Creating Zip
run: zip -r release.zip . -x ".git/*" ".github/*"
Run Code Online (Sandbox Code Playgroud)
这给了我一个错误:
> The term 'zip' is not recognized as a name of a cmdlet, function,
> script file, …Run Code Online (Sandbox Code Playgroud) git ×4
github ×3
gitlab ×3
argocd ×1
binary ×1
binaryfiles ×1
branch ×1
filenames ×1
git-config ×1
git-fetch ×1
git-merge ×1
git-remote ×1
gitlab-ci ×1
gitops ×1
gulp ×1
kubernetes ×1
node.js ×1
push ×1
repository ×1
sonarqube ×1
ssh ×1
unix ×1