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.
186
questions
34
votes
5
answers
25k
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 ...
27
votes
5
answers
187k
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 ...
23
votes
4
answers
6k
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 ...
23
votes
1
answer
1k
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 ...
18
votes
3
answers
6k
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
3
answers
1k
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
2
answers
14k
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 ...
13
votes
3
answers
377
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 ...
13
votes
2
answers
3k
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: ...
11
votes
4
answers
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
2
answers
6k
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 ...
11
votes
2
answers
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
1
answer
8k
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 ...
10
votes
2
answers
9k
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 (...
8
votes
1
answer
2k
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?
8
votes
3
answers
3k
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
3
answers
1k
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
3
answers
352
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
1
answer
4k
views
Is it possible to view all changes made on a Git feature branch in Azure Devops?
Azure DevOps offers the overview of changes made in a branch when a PR is created. However, sometimes I'd like to have access to that overview when viewing a branch without the need to create a PR (or ...
8
votes
1
answer
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 ...
8
votes
1
answer
2k
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
3
answers
15k
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). ...
7
votes
2
answers
412
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
2
answers
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
4
answers
3k
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
3
answers
2k
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 ...
7
votes
2
answers
50k
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 ...
7
votes
2
answers
9k
views
Git-based CI/CD Pipeline for Monorepo
Are there established CI/CD strategies & best practices for working with a distributed team on a project that is utilizing monorepos?
I can provide two specific use-cases:
Working on content ...
6
votes
1
answer
5k
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?
6
votes
4
answers
2k
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
1
answer
6k
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
2
answers
842
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 ...
5
votes
2
answers
2k
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
1
answer
12k
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
3
answers
4k
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
2
answers
747
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
2
answers
1k
views
What is the way to update images in a configuration git repository when doing gitops?
i'm trying to do gitops
I have a Configuration repo containing k8 manifests and different app repos.
1) App repo's CI build docker images and pushes into registry.
2) App repo's CI commits into ...
5
votes
2
answers
3k
views
Jenkins trigger build if shared library changes
I have Jenkins Pipeline job define in my git repo as.
// File: deployment/jenkinsfiles/staging/Merge
@Library("my_shared_lib") _
import com.company.myteam.Constants
pipeline {
agent { label "...
5
votes
1
answer
225
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
1
answer
934
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 ...
5
votes
1
answer
2k
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
2
answers
313
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
2
answers
8k
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
2
answers
137
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
4
answers
8k
views
Is there a way to use a Jenkinsfile from a git-submodule in a multibranch pipeline?
Background:
The nature of our project's source involves multiple long-living branches, each one has its own Jenkins job (manually created).
Multibranch limitation:
Unfortunately we do not use a ...
4
votes
1
answer
3k
views
How to ansible-vault files as they are commited to Git
I'm trying to use ansible-vault to secure the secret files in my project before I push them to Git.
There's loads of advice out there on how to set this up in part, but everything I've read is ...
4
votes
1
answer
488
views
What's the practice to perform a releasing with Git?
I'm using GitLab CE with Maven project, and try to follow the Environment branches with GitLab flow and The 11 Rules of GitLab Flow
The step for releasing is as the following: -
feature +--- +-...
4
votes
1
answer
142
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
3
answers
853
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
2
answers
34k
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...
...