Questions tagged [git]

Use this tag for questions about Git, a free and open source distributed version control system, related to using Git for topics such as continuous delivery, monitoring, building SDLC infrastructure, etc.

Filter by
Sorted by
Tagged with
30
votes
5answers
16k views

Where to put ansible-vault password

We are planning to use ansible vault in our project to prevent leaking passwords or keys in git. The idea is to put all our sensitive data into a plain file then encrypt this file with ansible-vault ...
21
votes
4answers
3k views

How to get rid of develop branch for simplified Git flow

In a continuously developed web project (not a product) we currently have the following branching strategy, roughly based on git flow: develop branch: latest working version master branch: version to ...
20
votes
1answer
709 views

Git clean/smudge filters for ansible vault secrets

I am trying to setup clean/smudge filter in git to have automatic encrypting and decrypting of files containing secrets thru ansible-vault command. Peculiarity of the ansible-vault command is that it ...
17
votes
3answers
5k views

Which SCM tools does Jenkins support?

I'm aware that Jenkins supports Git and SVN. What other SCM tools does Jenkins support?
14
votes
3answers
895 views

Getting a single revision from Git

Having the full Git revision history has a lot of benefits as part of the development process. But our product is the source code, we are using scripted languages that don't need compilation or ...
13
votes
3answers
267 views

How are you enforcing git behavior, including locally (particularly on Windows)?

I'm taking point on moving this .NET shop from svn to git, and have identified some ancillary issues I'd like to have a solution for before we flip the switch. The one I'm asking about in particular ...
11
votes
4answers
3k views

How to structure DevOps related code and configs in a code repository?

We've been growing as a company, our products are expanding and our DevOps related activities and efforts are growing as well - we've switched from Bamboo to a more flexible and configurable Jenkins, ...
11
votes
2answers
1k views

Is it possible to autodeploy on every commit in a specific branch using Travis CI and GitHub?

I'd like to deploy files using Travis CI and it only works for a tagged commit. When committing to the branch, there is a warning: Skipping a deployment with the releases provider because this is ...
10
votes
4answers
29k views

How to resolve merge conflicts in Azure DevOps current UI

I have followed the instructions on command line: https://docs.microsoft.com/en-us/azure/devops/repos/git/merging?view=azure-devops&tabs=visual-studio all I want to do is resolve this merge ...
10
votes
2answers
5k views

Git & Jenkins: get latest green commit on branch

We're just starting to push for CI-CD and as a baby step we're going to try updating a stack with the latest green develop once every couple of hours. I am fairly new to Git/Bitbucket, and can't ...
10
votes
2answers
2k views

how to automatically create a subdomain for every pull request

Background I got a team of untechnical QA's who have to do testing on iOS/android apps for every Pull Request (PR) that gets created by my backend team. Question This is what I want to do: ...
10
votes
2answers
6k views

Git seems to recognize http.sslcainfo property from .gitconfig but ignores it on execution? SEC_E_UNTRUSTED_ROOT

all, I have a working certificates chain (testable with OpenSSL) but somehow I cannot manage to tell Git to load these certificates. I get the same "untrusted root authority" error (...
9
votes
1answer
6k views

How do I trigger scripts on a merge or when a branch is deleted?

I am using jenkins multibranch pipelines. If a branch is merged and deleted jenkins removes the branch from the pipeline as well. This is great, but I want to run a command/script when a branch is ...
8
votes
3answers
2k views

How to create staging servers for multiple git branches?

I have to create a new staging process for our development and testing. At any given time, there are only around 4 git branches actively being developed and tested. Within each git branch, there may ...
8
votes
3answers
163 views

Should developer wait for CI pipeline to complete or start next task after pushing

My company is integrating CI/CD, so far we have implemented CI from what I understand. Currently when a developer pushes code to our git repo, the CI pipeline runs. Currently our CI pipeline include ...
8
votes
3answers
209 views

What's a good devops approach for a single developer writing python web applications?

I'm guessing this question will seem incredibly trivial for some readers, but as someone who is a developer but with little experience of deploying apps in anything other than a manual, hit and hope ...
8
votes
1answer
736 views

How to ensure that git subtrees are kept up to date?

Problem: We use Data Transfer Objects (DTO) to ensure consistent interfaces across multiple services using TypeScript. We're currently using a git subtree in order to make sure that each ...
7
votes
2answers
371 views

What branching strategies/workflows are available for Git repositories?

I'm looking for a high-level, summary description of the recommended branching strategies/workflows primarily applicable with Git, which would serve as a guide for navigating this environment. ...
7
votes
1answer
1k views

What is the difference between DevOps and GitOps?

I am hearing nowadays a lot about GitOps. What is the difference between DevOps and GitOps? Is it just the SCM does the build and deploy when there is a commit instead of the CI/CD tool exclusively?
7
votes
2answers
2k views

What is the exact use of DETACHED HEAD state in Git?

When I checkout a specific commit hash, it goes to detached mode where HEAD POINTER can't point to a recent commit. What are the things we can do and what is the use of going detached head state in ...
7
votes
4answers
2k views

Ansible - private git repositories - SSH agent forwarding vs copying private SSH key

I recently started playing around with Ansible and it seems very nice. I don't have much experience in DevOps stuff and never really had to handle any complex scenarios. I started creating my Ansible ...
7
votes
1answer
1k views

Can GitHub's Pull Request model be used for implementing post approvals?

The accepted answer to "What are possible implementations (or examples) of the four-eyes principle?" suggests that GitHub's Pull Request model is a possible implementation. And my own answer to "How ...
6
votes
4answers
1k views

What do you need for a monorepo for a large codebase?

From certain size of the codebase, would you still have Git or are there more specialized solutions? (Also to checkout just a part of the codebase)
6
votes
3answers
77 views

How long is it appropriate to keep old feature branches in git?

I am on a large team with many developers. We have a large codebase that has many feature branches from our large group of developers. We are accumulating many feature branches. We generally look to ...
6
votes
1answer
3k views

Multi-language Monorepo

We currently have a "front-end" git repository that is all of our JavaScript client apps, and a "back-end" git repository containing all back end APIs written in .NET Core. There is also a few other ...
5
votes
1answer
1k views

Where is the git submodule revision actually stored?

I understand how to use git submodule to reference a specific commit in another repo, but where is that reference actually stored? It doesn't seem to be in .gitmodules as plain text?
5
votes
2answers
1k views

Coupling docker registry and source control

What are the best practices (if any) for coupling a docker image registry with a SCM service (such as bitbucket)? I know a docker registry can live in artifactory, but how can I assure that the two ...
5
votes
1answer
7k views

What git command could be used to check when a remote branch was created?

Git is used at work. The number of branches is growing and growing. The aim is to remove branches that are older than X weeks. Attempt 1 Running git branch -h will probably indicate what to run to ...
5
votes
2answers
28k views

fatal: ambiguous argument 'master': unknown revision or path not in the working tree

when I modified one of my cookbook that I tried to add a cookbook dependency in berks file cookbook name, '=0.1.0', git: 'ssh://url:xxx/cookbook', tag: '0.0.1' and then tried to converge it which ...
5
votes
2answers
598 views

Are git pre-receive/update hooks serialized?

I'm investigating the possibility of implementing a "pre-commit" verification flow, enforced on the central SCM server side. By "pre-commit" in this paragraph I don't mean the git pre-commit hook, I ...
5
votes
2answers
2k views

Validating certificates with get_url or yum on CentOS 7 using Ansible

I'm pretty new to Ansible, but it seemed a better tool than a bash script for installing programs from source on remote servers... Starting from my working-but-fragile bash script, I made an Ansible ...
5
votes
1answer
100 views

How to keep many servers (5000+) up-to-date?

Initially asked here: https://stackoverflow.com/questions/60674502/how-to-keep-many-servers-5000-up-to-date-with-git-and-its-rate-limits The initial post: We're making a php service that will run on ...
5
votes
1answer
3k views

jenkins fatal: ambiguous argument, unknown revision or path not in the working tree

In jenkins pipeline, execute git command : git log --format=%B --no-merges origin/master..origin/${currentBranch} jenkins output error : fatal: ambiguous argument 'origin/master..origin/XOPS-...
5
votes
1answer
1k views

SVN Externals in Git

I have a handful of projects that utilize SVN externals. How should these externals be handled in Git? For reference, these externals are shared by multiple repositories and are updated very ...
4
votes
3answers
9k views

Jenkins shows the job as failed if there is nothing to commit to gitlab

I have been using one Jenkins job, that will pull repository from gitlab. Then it will modify the files and push it into gitlab (only if any user added any new files/modify contents in gitlab). ...
4
votes
2answers
163 views

Continuous Integration and Isolated Feature Testing

I've been given the task at work to move everyone from using TFS Source Control to Git as the Development Team has been lead to believe that Git may well be the silver bullet that will fix alot of the ...
4
votes
2answers
5k views

How to “docker-compose build” a service from code located in local git repository?

I have a git repository placed in local file system at /home/nou/code/lib.git Also I have /home/nou/docker-compose.yaml that is used to deploy a service based on the code from the repo: version: '2' ...
4
votes
2answers
113 views

If a piece of work requires manual testing/QA, do we need to wait until opening PR?

First question here (i'm usually on StackOverflow)...not sure if the right place (if not, please vote to move where it belongs). If we have a dev process using traditional GitFlow approach, what ...
4
votes
2answers
81 views

What are feasible quality criteria for Git repositories?

If you manage a lot of Git repositories (or other, but Git is a specific and common technology), it could happen that depending on users there will be quite different usage profiles. On the worst case ...
4
votes
1answer
794 views

Heroku Slack integration without using Github

Heroku has this great Slack chatbot (chatops) that lets you send messages if a deployment pipeline succeeded or failed. Unfortunately, while setting it up and logging in to Heroku, it asks for your ...
4
votes
1answer
71 views

Deploying and testing features on a server by more than one developer

I have 4 environments (prod/preprod/SIT/DEV), also two main branches (Master & Develop), two developers work on features (One & Two). Developer One creates a feature (Feature A), he then ...
4
votes
3answers
421 views

Tips for separating DevOps Git repos?

We currently have a Git repo with automation code (with tests), iaas-code and lamba-code. The automation code is mostly Fabric, Python and unittests. The Iaas-code is mostly CloudFormation, Docker-...
4
votes
2answers
10k views

JenkinsFile to get git branch name

I want to get git current checkout BRANCH NAME in my Jenkins file here is the code snippet... Here I am trying to push a file to my current branch I have tried many things could not find it... ...
4
votes
3answers
175 views

What options are available to encrypt the content of git repositories?

git-crypt, git secret were found. What is your personal preference and why? A couple of months ago, I have applied git-crypt. It was quite hard to set it up and the secrets are stored as binaries. I ...
4
votes
1answer
45 views

I need a good tool for running a series of Spring Boot based tools on Docker, where each needs a web page and a database connection

These are pretty much just tools our support and ops departments need to solve small tasks which crop up as a routine sideeffect of our main business operation. They might need to find all instances ...
4
votes
1answer
990 views

Automatic Docker Hub builds from GitLAB, not github

As per title. I would like to configure automated builds on Docker Hub, as specified here. My build context (the build context is a repository containing a Dockerfile) is hosted in GitLAB.
4
votes
2answers
2k views

Jenkins configuration to support multi-config multi-branch CI

Here are my requirements and I go back-and-forth on how to achieve them: Must build Java spring-boot apps Artifacts must be released to artifactory repository Docker image to be built directly ...
4
votes
1answer
671 views

How to implement GitLab Flow branching model for microservices?

Recently I’ve been looking into alternatives to the git flow branching model and since I’m already using GitLab, I stumbled upon their own branching model called GitLab flow. I’m currently trying to ...
4
votes
3answers
212 views

How to automatically publish git releases/comments to the site?

Sorry if title isn't correct. I'm trying to figure out what to search for on this matter. I'm looking for the easiest way to automatically have my semantic versioning and commits visible on my site ...
4
votes
0answers
556 views

Problems with integrating Python script in a Bash script Git pre-receive hook [closed]

We have a pre-receive hook script in a bash shell script that enforces commits with messages having the right ticket number in a pre-defined format. We also have a separate python script that can be ...