2022 Developer Survey is open! Take survey.

Hot answers tagged

18 votes
Accepted

Which SCM tools does Jenkins support?

It supports AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC. For all of them exists a plugin and as you probably already know, Jenkins is not limited to only that list, anyone ...
user avatar
  • 1,262
16 votes
Accepted

Getting a single revision from Git

Shallow clone You can indeed get a shallow clone out of Git using: git clone --depth=1 <url> This will still clone the repo and create a .git folder with the objects, only smaller in size (...
user avatar
  • 934
15 votes
Accepted

Where to put ansible-vault password

The idea is to put all our sensitive data [...] The meaning of "all" in this sentence should be analyzed very carefully before implementing the solution that you plan. Ansible vault is a very useful ...
user avatar
13 votes
Accepted

What is the difference between DevOps and GitOps?

GitOps is a technique of using Git to manage infrastructure provisioning and software deployments. This technique uses many of the features of Git such as Pull Requests to manage and trigger ...
user avatar
11 votes
Accepted

What branching strategies/workflows are available for Git repositories?

The Atlassian website includes a comparison of different workflow strategies available when concerned with Git. More strategies exist, like the one used by Linux Kernel team, but are not relevant to ...
user avatar
11 votes

Getting a single revision from Git

Don't deploy your git repo. Develop a real deployment methodology. Even if it's as simple as tarring up an archive (= building an artifact with just the necessary files in it to be deployed) of ...
user avatar
11 votes

How to get rid of develop branch for simplified Git flow

Let's say you take out the master branch (you can rename develop to master to confuse your team if you like later) and simply use tags for releases either on develop or hotfix branches. You took out ...
user avatar
  • 5,607
11 votes
Accepted

How to resolve merge conflicts in Azure DevOps current UI

Try this solution: Pull Request Merge Conflict Extension. It helps to resolve conflicts inside the pull request page.
user avatar
9 votes

Which SCM tools does Jenkins support?

In addition to the list in the previous answer, there is also the plugin that integrates Serena Dimensions CM with Jenkins. Some more details about this plugin (from the linked page): The plugin ...
user avatar
  • 6,878
9 votes

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

In my automatic jenkins job, launched daily, if there are no changes the git commit command returns 1. That will mark the build as failed. To solve this problem I use these two commands in my shell ...
user avatar
9 votes

Where to put ansible-vault password

We are planning to use ansible vault in our project to prevent leaking passwords or keys in git. Since you haven't yet implemented anything, you might reconsider this. Using a system like Ansible ...
user avatar
9 votes
Accepted

Git Files Encryption for Business

There really is no way to take on your problem with git, which is to deny a developer with access to the code (required to work with it) the possibility to steal the code. This is because as soon as ...
user avatar
  • 4,696
9 votes
Accepted

Where is the git submodule revision actually stored?

The .gitmodules file just records the path and remote URL to the submodule repository. The commit itself is stored in the tree object. You can query it like this: git ls-tree <ref> <path> ...
user avatar
  • 330
8 votes

Git clean/smudge filters for ansible vault secrets

The problem here is caused by the random salt in ansible-vault encryption. You can hack VaultEditor class to pass the salt to it from an argument in ansible-vault. The random salt is generated in lib/...
user avatar
  • 5,607
8 votes
Accepted

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

The "normal" way of working with GIT is by checking out branches. HEAD is a "pointer" to the latest commit in that branch, and GIT will allow you to commit new changes after that ...
user avatar
  • 204
7 votes
Accepted

How to get rid of develop branch for simplified Git flow

IMHO the problems you're facing are just a side effect of the poor branch strategy you started with: you're effectively plowing new development on develop (i.e. what converges towards the future ...
user avatar
7 votes

How to create staging servers for multiple git branches?

1) How can I run several different branches on the staging server? Docker 2) How would I set up the DB evolution system to make sure it always has appropriate DB for each branch? This depends on ...
user avatar
  • 3,655
7 votes
Accepted

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

Sit and watch the pipeline run? No, that is not how you work efficiently. Developers push their commits to the source control repository and then the CI/CD pipeline is triggered. Developers may ...
user avatar
  • 905
6 votes
Accepted

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

In order to get a success, you need to avoid non-zero exit codes. A simple solution would be to change the last line of your script to git commit -a -m 'Changes pushed by Jenkins' || true, but better ...
user avatar
  • 186
6 votes
Accepted

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

To answer the question of how to enforce something locally, you can't without doing some very heavy lifting around managing and enforcing the state of every developers workstation, and I'm usually of ...
user avatar
  • 1,634
6 votes
Accepted

Git & Jenkins: get latest green commit on branch

You don't make any mention of the scripting language you want to use, so I will talk specifically about the HTTP requests to the BitBucket API: Assumptions If you have a BitBucket Repository that ...
user avatar
6 votes

Getting a single revision from Git

Question is there a way to get a single revision from Git without it's history ? To get a repository, no there's no way, mainly because there's no 'revision'. Git store commits, which are changes ...
user avatar
  • 11k
6 votes

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

Instead of using Travis' deployment features, build the deployment logic in to your normal "test" script(s). For a PaaS this might be as simple as pushing to another git remote if all tests pass, but ...
user avatar
  • 1,197
6 votes

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

I can answer bout docker, one of the best practice to use docker is to keep the docker file and the compose files in the same repository of the project, so wherever you clone the project you can build ...
user avatar
6 votes

Need a folder, always updated with the latest code from Git

Use a Git post-receive hook to issue a git pull in the directory you want to keep updated. You might want to mount the directory you want to keep updated locally to the Git server, or execute that ...
user avatar
  • 1,076
6 votes

how to automatically create a subdomain for every pull request

We do this at work. We have a small server, let's call it the receiver, it's the target of the GitHub webhook events. It runs a small application that parses the payload and incorporates logic around ...
user avatar
6 votes

Continuous Integration and Isolated Feature Testing

First of all, git is certainly not to blame for merges taking a long time. Clean merging is the hallmark of git, unless it is used in some broken way. So I encourage you to look at what exactly seems ...
user avatar
  • 4,696
6 votes
Accepted

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

Note: this answer shows how to find branches that have been *updated* a long time ago, not branches that have been *created* (i.e., spliced off of some parent) a long time ago. I believe this is what ...
user avatar
  • 4,696
6 votes

How to keep original and new repositories in sync during a migration? (including the commit history)

Simply keep pushing stuff between the repositories. Git pushes are designed for exactly that. So, if origin is the old repository, and newis the new one, and you want to move new stuff in the master ...
user avatar
  • 4,696
6 votes
Accepted

Multi-language Monorepo

Monorepos have been getting a lot of attention in recent years since google popularized them. If you aren't on a similar scale as google it might not work out as well for you. I've been in a startup ...
user avatar
  • 1,728

Only top scored, non community-wiki answers of a minimum length are eligible