# \#git

**URL:** https://discuss.circleci.com/tag/git/112.md

[Latest](https://discuss.circleci.com/latest.md) · [Categories](https://discuss.circleci.com/categories.md) · [Tags](https://discuss.circleci.com/tags.md)

---

## [Suggestions for Speeding Up Workspace Persistence Step of Code Checkout](https://discuss.circleci.com/t/suggestions-for-speeding-up-workspace-persistence-step-of-code-checkout/51285)

<div class="topic-metadata">

**Author:** [@chrismerck](https://discuss.circleci.com/u/chrismerck)\
**Replies:** 2\
**Last updated:** [June 29, 2024, 8:31pm UTC](https://discuss.circleci.com/t/suggestions-for-speeding-up-workspace-persistence-step-of-code-checkout/51285 "2024-06-29T20:31:54Z")

</div>

We are pretty heavy CircleCI users over at Bond. Every commit associated with a PR in our firmware monorepo triggers a build of images for all ~60 products. Over time our checkout\_code step has been getting slower. It t…

---

## [How can I stop CircleCi from automatically deleting branches that are deleted from github?](https://discuss.circleci.com/t/how-can-i-stop-circleci-from-automatically-deleting-branches-that-are-deleted-from-github/47000)

<div class="topic-metadata">

**Author:** [@TeyimPila](https://discuss.circleci.com/u/TeyimPila)\
**Replies:** 0\
**Last updated:** [February 7, 2023, 3:18pm UTC](https://discuss.circleci.com/t/how-can-i-stop-circleci-from-automatically-deleting-branches-that-are-deleted-from-github/47000 "2023-02-07T15:18:55Z")

</div>

I have a workflow on CircleCi that builds and deploys a branch to AWS when a pull request is open from that branch. The pipeline is triggered by a curl request from a Github action. I have a second workflow that tears d…

---

## [Hability to merge, commit and push](https://discuss.circleci.com/t/hability-to-merge-commit-and-push/46653)

<div class="topic-metadata">

**Author:** [@alexandreL](https://discuss.circleci.com/u/alexandreL)\
**Replies:** 1\
**Last updated:** [February 2, 2023, 8:45pm UTC](https://discuss.circleci.com/t/hability-to-merge-commit-and-push/46653 "2023-02-02T20:45:00Z")

</div>

Hello, In our gitflow organization, like this: main release/x.y.z hotfix/x.y.z develop I need that once the release/x.y.z or the hotfix/x.y.z is merge on main, the cli pull develop, merge main in develop and push dev…

---

## [Git checkout during build suddenly no longer working](https://discuss.circleci.com/t/git-checkout-during-build-suddenly-no-longer-working/46680)

<div class="topic-metadata">

**Author:** [@gorner](https://discuss.circleci.com/u/gorner)\
**Replies:** 1\
**Last updated:** [January 11, 2023, 4:10pm UTC](https://discuss.circleci.com/t/git-checkout-during-build-suddenly-no-longer-working/46680 "2023-01-11T16:10:25Z")

</div>

We have been using CircleCI for CI on a couple of projects including a front-end web build running on a Node image on a Docker instance. All of a sudden, since yesterday afternoon our builds have been uniformly failing a…

---

## [Using git commit message as a condition](https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866)

<div class="topic-metadata">

**Author:** [@daniel12599](https://discuss.circleci.com/u/daniel12599)\
**Replies:** 2\
**Last updated:** [December 27, 2022, 8:39am UTC](https://discuss.circleci.com/t/using-git-commit-message-as-a-condition/45866 "2022-12-27T08:39:39Z")

</div>

Hey, So I have an expansive test that I don’t want to run on every commit in my circle ci workflow. I found that I can use ‘\[ci stop\]’ in my commit message but it stops the whole workflow. And I want to skip only one s…

---

## [Use of \<\< pipeline.git.tag \>\> in workflows.$name.when](https://discuss.circleci.com/t/use-of-pipeline-git-tag-in-workflows-name-when/36159)

<div class="topic-metadata">

**Author:** [@yamlcoder](https://discuss.circleci.com/u/yamlcoder)\
**Replies:** 11\
**Last updated:** [September 21, 2022, 11:56am UTC](https://discuss.circleci.com/t/use-of-pipeline-git-tag-in-workflows-name-when/36159 "2022-09-21T11:56:40Z")

</div>

Following snippet doesn’t create pipeline, when I push tag, it still requires filters.tags specified on every job workflows: version: 2 deploy\_uat: when: equal: \[uat, \<\< pipeline.git.tag \>\>\] jobs: …

---

## [Git checkout of a branch destroys local reference to master](https://discuss.circleci.com/t/git-checkout-of-a-branch-destroys-local-reference-to-master/23781)

<div class="topic-metadata">

**Author:** [@dmeneses](https://discuss.circleci.com/u/dmeneses)\
**Replies:** 15\
**Last updated:** [August 18, 2022, 7:17pm UTC](https://discuss.circleci.com/t/git-checkout-of-a-branch-destroys-local-reference-to-master/23781 "2022-08-18T19:17:22Z")

</div>

When building a branch (let’s say branch1), the Checkout code step will do this after cloning the git repository: git reset --hard "$CIRCLE\_SHA1" git checkout -q -B "$CIRCLE\_BRANCH" git reset --hard "$CIRCLE\_SHA1" This…

---

## [How to run jobs conditionally based on a merging branch name?](https://discuss.circleci.com/t/how-to-run-jobs-conditionally-based-on-a-merging-branch-name/44729)

<div class="topic-metadata">

**Author:** [@nlhkha](https://discuss.circleci.com/u/nlhkha)\
**Replies:** 2\
**Last updated:** [July 19, 2022, 4:56pm UTC](https://discuss.circleci.com/t/how-to-run-jobs-conditionally-based-on-a-merging-branch-name/44729 "2022-07-19T16:56:44Z")

</div>

I am using Gitflow to manage code commits, so I have 2 working branches: Main Develop Upon a successful build, I also push a built docker image to Docker Hub repo. Now let’s see what will happen during Gitflow stages: …

---

## [Git tag triggers a pipeline only the first time](https://discuss.circleci.com/t/git-tag-triggers-a-pipeline-only-the-first-time/44372)

<div class="topic-metadata">

**Author:** [@fjinkis](https://discuss.circleci.com/u/fjinkis)\
**Replies:** 7\
**Last updated:** [June 15, 2022, 7:30pm UTC](https://discuss.circleci.com/t/git-tag-triggers-a-pipeline-only-the-first-time/44372 "2022-06-15T19:30:28Z")

</div>

Hi folks! I’m having troubles to implement some kind of pipeline when a pre-existing tag is already “linked” to a commit. First of all, this is my config (let’s imagine for now that those scripts are just an ‘echo’ sayi…

---

## [Can't get git-diff on CircleCI Job](https://discuss.circleci.com/t/cant-get-git-diff-on-circleci-job/37644)

<div class="topic-metadata">

**Author:** [@Bodacious](https://discuss.circleci.com/u/Bodacious)\
**Replies:** 5\
**Last updated:** [May 30, 2022, 11:34pm UTC](https://discuss.circleci.com/t/cant-get-git-diff-on-circleci-job/37644 "2022-05-30T23:34:04Z")

</div>

I need a git diff of the files that have changed between my feature branch and develop. The list of changed files is fed into the rubocop linter to check for violations being pushed out with this branch. When I run the …

---

## [Why the hell circleci remove my .env file?](https://discuss.circleci.com/t/why-the-hell-circleci-remove-my-env-file/43267)

<div class="topic-metadata">

**Author:** [@David-Crty](https://discuss.circleci.com/u/David-Crty)\
**Replies:** 1\
**Last updated:** [March 25, 2022, 11:29pm UTC](https://discuss.circleci.com/t/why-the-hell-circleci-remove-my-env-file/43267 "2022-03-25T23:29:50Z")

</div>

I’m trying to move to circleci, we have a symfony project and we do commit the “.env”, it contain all the default env variable of our project (like done here GitHub - symfony/demo: Symfony Demo Application). I realize t…

---

## [Checkout step stuck with github SSH host key authentication](https://discuss.circleci.com/t/checkout-step-stuck-with-github-ssh-host-key-authentication/42895)

<div class="topic-metadata">

**Author:** [@blackliner](https://discuss.circleci.com/u/blackliner)\
**Replies:** 1\
**Last updated:** [February 10, 2022, 3:08am UTC](https://discuss.circleci.com/t/checkout-step-stuck-with-github-ssh-host-key-authentication/42895 "2022-02-10T03:08:48Z")

</div>

Trying out CircleCI for the first time, encountering a showstopper in the first few minutes: Cloning into '.'... The authenticity of host 'github.com (140.82.112.4)' can't be established. ECDSA key fingerprint is SHA256…

---

## [File size mismatch when restoring the cache](https://discuss.circleci.com/t/file-size-mismatch-when-restoring-the-cache/42248)

<div class="topic-metadata">

**Author:** [@kacper](https://discuss.circleci.com/u/kacper)\
**Replies:** 2\
**Last updated:** [February 4, 2022, 3:35pm UTC](https://discuss.circleci.com/t/file-size-mismatch-when-restoring-the-cache/42248 "2022-02-04T15:35:00Z")

</div>

For about a month we’ve been frequently seeing errors similar to these: Found a cache from build 52425 at vf77e906d-b40c-49bd-a534-bc986582e5d9-git-CAS-8069/introduce-rate-limiting-5b8e93990251a03ca393490e3dc7379a94b11f…

---

## [How to go mod download a private remote package in Github (error: “could not read Username”)](https://discuss.circleci.com/t/how-to-go-mod-download-a-private-remote-package-in-github-error-could-not-read-username/32321)

<div class="topic-metadata">

**Author:** [@FradiFrad](https://discuss.circleci.com/u/FradiFrad)\
**Replies:** 3\
**Last updated:** [October 10, 2021, 8:34pm UTC](https://discuss.circleci.com/t/how-to-go-mod-download-a-private-remote-package-in-github-error-could-not-read-username/32321 "2021-10-10T20:34:35Z")

</div>

I’m trying to access a Go private remote package on my firm’s Github inside a CircleCI’s job. I’ve managed to get it in the test job, with: git config --global url."https://{user}:${token}@github.com/".insteadOf "https:…

---

## [Caching additional repositories that are used to build the project](https://discuss.circleci.com/t/caching-additional-repositories-that-are-used-to-build-the-project/41448)

<div class="topic-metadata">

**Author:** [@ababilia](https://discuss.circleci.com/u/ababilia)\
**Replies:** 0\
**Last updated:** [October 6, 2021, 10:21am UTC](https://discuss.circleci.com/t/caching-additional-repositories-that-are-used-to-build-the-project/41448 "2021-10-06T10:21:32Z")

</div>

Hello everyone, we have this config.yml In place of private, links to repositories version: 2.1 orbs: node: circleci/node@4.2.0 # Reusable commands commands: checkout-project-repos: parameters: branch: …

---

## [Which Git version of config.yml on build is used?](https://discuss.circleci.com/t/which-git-version-of-config-yml-on-build-is-used/39188)

<div class="topic-metadata">

**Author:** [@vincenzorm117](https://discuss.circleci.com/u/vincenzorm117)\
**Replies:** 2\
**Last updated:** [June 25, 2021, 4:17pm UTC](https://discuss.circleci.com/t/which-git-version-of-config-yml-on-build-is-used/39188 "2021-06-25T16:17:16Z")

</div>

Hi When a CircleCI build runs, does the build use the config.yml from the commit it checks out from Git?

---

## [CircleCI Job Modifying Fastfile to a Previous or Earlier Commit](https://discuss.circleci.com/t/circleci-job-modifying-fastfile-to-a-previous-or-earlier-commit/39363)

<div class="topic-metadata">

**Author:** [@mteece](https://discuss.circleci.com/u/mteece)\
**Replies:** 4\
**Last updated:** [June 3, 2021, 4:25pm UTC](https://discuss.circleci.com/t/circleci-job-modifying-fastfile-to-a-previous-or-earlier-commit/39363 "2021-06-03T16:25:36Z")

</div>

For the past few weeks our iOS builds have been failing via errors in Fastlane. When we go to troubleshoot everything works as expected locally, and then we push those changes upstream. CircleCI is then triggered to star…

---

## [Git commit differences when pushing a commit vs a tag](https://discuss.circleci.com/t/git-commit-differences-when-pushing-a-commit-vs-a-tag/39037)

<div class="topic-metadata">

**Author:** [@stephenryanlee](https://discuss.circleci.com/u/stephenryanlee)\
**Replies:** 2\
**Last updated:** [February 8, 2021, 4:14pm UTC](https://discuss.circleci.com/t/git-commit-differences-when-pushing-a-commit-vs-a-tag/39037 "2021-02-08T16:14:03Z")

</div>

Hi all, I have a project configured such that when I push commits to the github repo, it will run a build that does some tests. Further, if I push a specifically-formatted tag to my repo, Circle will run another job to…

---

## [The checkout step mangles branches, messes the history](https://discuss.circleci.com/t/the-checkout-step-mangles-branches-messes-the-history/24975)

<div class="topic-metadata">

**Author:** [@cans](https://discuss.circleci.com/u/cans)\
**Replies:** 0\
**Last updated:** [September 8, 2018, 1:46pm UTC](https://discuss.circleci.com/t/the-checkout-step-mangles-branches-messes-the-history/24975 "2018-09-08T13:46:23Z")

</div>

Where I work we deal with a bit of legacy and sometimes voluntarily stack up technical debt, to move faster, stay ahead of the competition. But when we wanted to pay it back, we got a hard time applying some of the check…

---

## [Can't add SSH key to command](https://discuss.circleci.com/t/cant-add-ssh-key-to-command/35953)

<div class="topic-metadata">

**Author:** [@Krapalniy](https://discuss.circleci.com/u/Krapalniy)\
**Replies:** 1\
**Last updated:** [May 15, 2020, 3:34pm UTC](https://discuss.circleci.com/t/cant-add-ssh-key-to-command/35953 "2020-05-15T15:34:31Z")

</div>

I try to push code to the server via git ftp tool. But I can’t add key. I have already add ssh key to “Additional SSH Keys” and use command add\_ssh\_keys and fingerprints this key. BUT I DON’T know how to add this to comm…

---

## [Git rev-list --count develop..$CIRCLE\_SHA1 returns 0](https://discuss.circleci.com/t/git-rev-list-count-develop-circle-sha1-returns-0/35468)

<div class="topic-metadata">

**Author:** [@ozimos](https://discuss.circleci.com/u/ozimos)\
**Replies:** 1\
**Last updated:** [April 21, 2020, 4:37pm UTC](https://discuss.circleci.com/t/git-rev-list-count-develop-circle-sha1-returns-0/35468 "2020-04-21T16:37:11Z")

</div>

For this repro repo in a CircleCI pipeline build job git rev-list --count develop..$CIRCLE\_SHA1 returns 0. Ditto for git rev-list --count develop..HEAD. Also git rev-list develop..HEAD does nothing. All the git …

---

## ['git branch --contains' on CircleCI shows a branch that doesn't have the commit](https://discuss.circleci.com/t/git-branch-contains-on-circleci-shows-a-branch-that-doesnt-have-the-commit/35049)

<div class="topic-metadata">

**Author:** [@marcvit](https://discuss.circleci.com/u/marcvit)\
**Replies:** 0\
**Last updated:** [March 18, 2020, 8:29pm UTC](https://discuss.circleci.com/t/git-branch-contains-on-circleci-shows-a-branch-that-doesnt-have-the-commit/35049 "2020-03-18T20:29:33Z")

</div>

I want to trigger a build only if a tag refers to a commit contained in master. Fir this purpose, I have a run step that executes: if ! git branch --contains $CIRCLE\_TAG | grep master \> /dev/null; then exit 1; fi I’m …

---

## [Package.json dependency uses git and fails](https://discuss.circleci.com/t/package-json-dependency-uses-git-and-fails/34267)

<div class="topic-metadata">

**Author:** [@0dp](https://discuss.circleci.com/u/0dp)\
**Replies:** 1\
**Last updated:** [January 30, 2020, 12:15pm UTC](https://discuss.circleci.com/t/package-json-dependency-uses-git-and-fails/34267 "2020-01-30T12:15:19Z")

</div>

Hi there, Trying to setup my first build environment, and running into an issue. As part of my steps I am installing a global npm package that is required for deployment - run: name: install stencil-cli comman…

---

## [Delete Git Branch](https://discuss.circleci.com/t/delete-git-branch/28443)

<div class="topic-metadata">

**Author:** [@adelatuduce](https://discuss.circleci.com/u/adelatuduce)\
**Replies:** 5\
**Last updated:** [February 20, 2019, 2:51pm UTC](https://discuss.circleci.com/t/delete-git-branch/28443 "2019-02-20T14:51:05Z")

</div>

Hello, I was wondering if there is an option to delete a branch after a merge build is finished in Circle CI. From what I saw, we only have available a CIRCLE\_BRANCH env variable, which provides the name of the branch b…

---

## [Checkout code overwriting node\_modules generated during image build](https://discuss.circleci.com/t/checkout-code-overwriting-node-modules-generated-during-image-build/28229)

<div class="topic-metadata">

**Author:** [@robbymarston](https://discuss.circleci.com/u/robbymarston)\
**Replies:** 0\
**Last updated:** [February 7, 2019, 5:05pm UTC](https://discuss.circleci.com/t/checkout-code-overwriting-node-modules-generated-during-image-build/28229 "2019-02-07T17:05:20Z")

</div>

I have a very basic image that runs a yarn command when built (see below). Locally, this creates the node\_modules directory and populates it with the appropriate packages. That said, the ‘Checkout code’ step in my Circle…

---

## [Reset git commit id](https://discuss.circleci.com/t/reset-git-commit-id/27851)

<div class="topic-metadata">

**Author:** [@MartinForReal](https://discuss.circleci.com/u/MartinForReal)\
**Replies:** 0\
**Last updated:** [January 22, 2019, 8:56am UTC](https://discuss.circleci.com/t/reset-git-commit-id/27851 "2019-01-22T08:56:09Z")

</div>

I reset the git history and circleci failed to get the correct commit id when I tried to rerun the build job. Could you please help check the build process for https://circleci.com/bb/mskj/go-common? Thanks!

---

## [Checkout fails on workflow triggered by annotated git tag](https://discuss.circleci.com/t/checkout-fails-on-workflow-triggered-by-annotated-git-tag/27272)

<div class="topic-metadata">

**Author:** [@rupertchen](https://discuss.circleci.com/u/rupertchen)\
**Replies:** 6\
**Last updated:** [January 6, 2019, 1:15am UTC](https://discuss.circleci.com/t/checkout-fails-on-workflow-triggered-by-annotated-git-tag/27272 "2019-01-06T01:15:19Z")

</div>

I have a workflow configured to run only when a release tag is created. Example job and workflow definitions: jobs: my\_job: steps: - checkout - run: more\_stuff workflows: version: 2 my\_workflow: …

---

## [Receiving error when checking out code](https://discuss.circleci.com/t/receiving-error-when-checking-out-code/26100)

<div class="topic-metadata">

**Author:** [@dhughes](https://discuss.circleci.com/u/dhughes)\
**Replies:** 5\
**Last updated:** [October 29, 2018, 8:07pm UTC](https://discuss.circleci.com/t/receiving-error-when-checking-out-code/26100 "2018-10-29T20:07:09Z")

</div>

We have been having a problem since last Friday where some of our branches (including master!) will fail when checking out code from Github. This is the associated output from the checkout: Warning: Permanently added th…

---

## [Updating submodules in a private repository](https://discuss.circleci.com/t/updating-submodules-in-a-private-repository/25981)

<div class="topic-metadata">

**Author:** [@Puasonych](https://discuss.circleci.com/u/Puasonych)\
**Replies:** 1\
**Last updated:** [October 25, 2018, 5:25am UTC](https://discuss.circleci.com/t/updating-submodules-in-a-private-repository/25981 "2018-10-25T05:25:25Z")

</div>

Good day! We really need your help! I want to configure CircleCI for a private repository that has “submodule”. Submodules are connected via ssh. The problem is similar to the topic: Submodule ‘Module’ (git @github.…

---

## [Not running job based on filter: tags: only and filter: branch: ignore](https://discuss.circleci.com/t/not-running-job-based-on-filter-tags-only-and-filter-branch-ignore/23379)

<div class="topic-metadata">

**Author:** [@tquinlan1992](https://discuss.circleci.com/u/tquinlan1992)\
**Replies:** 5\
**Last updated:** [September 10, 2018, 6:30pm UTC](https://discuss.circleci.com/t/not-running-job-based-on-filter-tags-only-and-filter-branch-ignore/23379 "2018-09-10T18:30:13Z")

</div>

This seems like the same exact issue as Build/workflow not triggered when tag is pushed that was solved. I’m not able to see what I’m doing different than the solution. With the following set up I cannot get the job to…

[Next page](https://discuss.circleci.com/tag/git/112.md?match_all_tags=true&page=1&tags%5B%5D=git)
