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.

Git is an open source distributed version control system.

From Homepage:

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Resources

Related tags:

190 questions
14
votes
3 answers

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 processing, and then the Git history becomes a burden…
Rsf
  • 340
  • 1
  • 9
8
votes
1 answer

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 repository has its DTO dependencies up to date. These DTOs…
Jack Murphy
  • 333
  • 2
  • 7
7
votes
2 answers

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 Git?
6
votes
3 answers

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 git-flow for best practices. How long should…
David West
  • 1,463
  • 3
  • 16
  • 25
5
votes
1 answer

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 check when a branch has been created. user@localhost…
030
  • 13,235
  • 16
  • 74
  • 173
4
votes
3 answers

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-compose and some Terraform. The AWS lamdas are…
ujjain
  • 241
  • 1
  • 5
3
votes
2 answers

How to handle updating binary files on a dev server with git

I have a dev site on a server which is synced with my git repo. The git repo does not track the media/ folder. I want to update the content on the dev server to mirror the live server, so will copy over the database and the media/ folder from live…
karatecode
  • 133
  • 2
3
votes
1 answer

Gathering timespan statistics from Git

I would like to easily query git to answer a question like the following: How much time passed from when a developer made a git commit to when that commit was merged to a default branch from a feature branch (if that pattern is being used) or was…
1
vote
1 answer

Can you delete project binaries from an Azure Devops repo

I have an existing repository in Azure DevOps that is currently tracking various /obj, /bin files (.dll, .pdb, .cache, etc.). I don't want to track these anymore; however I am worried that if I delete these files from my repository, then the project…
shlkp
  • 13
  • 2
1
vote
1 answer

Git feature branching strategy allows unapproved 'tag along' features

Context Our current operations consists of three servers: QA is a playground for devs to try out new features; Platform is the live customer facing application; Mock is a copy of Platform and functions as a staging area for new releases to be tested…
NS0
  • 11
  • 1
0
votes
2 answers

How to organize Gitflow releases with multiple environments for web application?

We use gitflow branching strategy for different reasons, one of them being complicated bureaucracy around releases. We have environments: dev, qa, preprod, prod. Once the developers finish their work in dev branch, we create release branch and…
tlzg
  • 103
  • 3
0
votes
0 answers

How to make each user run with its own credentials in my local Git?

I have a local git version control installed on RedHat 8 server. When I run git add *, it asks me to provide the sudo permissions which is sudo git add *. This makes the add run with the root for me. All the other team members do the same. When I…
0
votes
1 answer

how to pull only git logs without pulling the whole file tree and diffs

I have a server that has limited storage space and I need to track a git repository, but I am only interested in the log messages and not the whole repository (blobs, diffs, tags, ...). the repository that I'm willing to track has a large commit…
sepisoad
  • 101
  • 2
0
votes
1 answer

How to get branch hash using git command

I have JenkinsFile where I'm trying to get the hash for my current branch. I saw this post: https://stackoverflow.com/questions/9110478/how-to-find-the-hash-of-branch-in-git but when I tried to run def BranchHash = sh "git rev-parse ${BRANCH-NAME} I…
arielma
  • 339
  • 2
  • 9
  • 21
-2
votes
1 answer

How can I see HEAD temp pointer reference in Git?

Not the current working HEAD REFERENCE which points in our current branch.