3,285 questions
0
votes
0
answers
56
views
DevSecOps pipeline — scans run on test branch, but devs keep pushing to dev/preprod/prod, how to ensure new code is scanned before production?
I’m an intern working in DevSecOps. Our repo uses branches: test, dev, preprod, prod. I’ve set up scans (SAST, container scan , DAST ) triggered from the test branch.
But the dev team often pushes ...
-3
votes
0
answers
39
views
Remove Git log history [duplicate]
Issue:
Some code containing a Client ID and Client Secret was accidentally pushed to the integration branch. Although those changes have now been reverted, the issue is that multiple branches had ...
0
votes
0
answers
35
views
Git commit signing fails with "gpg: skipped ... No secret key" even after generating a key [duplicate]
I'm trying to set up Git to sign my commits using GPG on Windows, but I keep getting this error when committing:
gpg: skipped "CD01EE27925BFE93": No secret key
gpg: signing failed: No secret ...
-2
votes
3
answers
173
views
How can I work on multiple git branches at once?
Clarification: I'm asking about working on multiple branches in the same worktree. (I know how to work on multiple branches in separate worktrees, but that's not the question here.)
Suppose I'm ...
0
votes
0
answers
29
views
Installing github branch using composer [duplicate]
Is there a general / standard approach to installing a github branch when the "parent" is installed using composer?
To hopefully clarify: I would like to install this branch (PHP Dropbox SDK)...
0
votes
0
answers
33
views
How to handle semantic versioning when cloud and on-prem branches diverge?
I'm working on a project that maintains two active release branches:
10.0.x → for on-prem deployments
10.1.x → for cloud deployments
We have an automated system that merges changes from the on-prem ...
-1
votes
2
answers
134
views
git delete tags associated with removed branches
On GIT After I removed a branch there are tags still exists.
I used this command to delete local and then remote branch "brnch"
git branch -D "brnch"
git push origin --delete "...
6
votes
1
answer
94
views
git branch --create branchname works fine, but is not documented anywhere
git branch branchname creates new branch "branchname", we know that.
However,
git branch --create branchname also creates new branch "branchname":
yet the latter is not documented ...
2
votes
2
answers
134
views
Get only git branches which match / don't match the fetch specs from `.git/config`, and delete non-matching ones
Suppose I have a .git/config as follows:
[remote "origin"]
url = [email protected]:some/repo.git
fetch = +refs/heads/main:refs/remotes/origin/main
fetch = +refs/heads/...
0
votes
0
answers
78
views
How to resolve a merge conflict using command line or github [duplicate]
I submitted a few files, all to separate branches and made a PR. But my PRs were closed with unmerged commits because I had to fix some issues with my code. I resubmitted after and made new PRs but ...
-1
votes
4
answers
141
views
Sort branches but show current branch first
Can I sort branches by -committerdate, but also always show the current branch first?
git config --global branch.sort -committerdate
Shows more recently committed-on branches ahead of the current ...
0
votes
0
answers
67
views
Git release flow - versions STG vs PROD
Trying to implement simple release git flow and not understand which version I need to use for PROD.
Example:
3 branches - develop, release (for staging) and master (for prod). I can`t change this, I ...
0
votes
0
answers
42
views
gitlab backout changes from one env to another env
I have 2 feature branches A and B and three diff envs(test ,uat and prod).branch A made changes in file and commited and merged to test. Now after few days branch B made some changes to the same file ...
0
votes
0
answers
57
views
How merge everything into origin/master and get rid of origin/main?
I have a git repo backed by a BitBucket instance. In this repo I appear to have three branches:
main (my local branch I guess)
origin/master
origin/main
The master naming scheme seems to be the ...
1
vote
2
answers
150
views
How can I create a branch in my fork based off a branch in a different fork (of the same master)?
I have my own fork I’ve been working on for awhile:
https://github.com/udance4ever/batocera.linux/
I verified the work done in this branch of a fellow developer’s fork is something I wish to build ...
1
vote
2
answers
196
views
Running Multiple Application Instances on Different Branches in IntelliJ - Potential Class Loading Issues?
I'm trying to understand how IntelliJ handles class loading when running multiple instances of a Java application on different branches.
When you run an application directly from the IDE (like ...
2
votes
2
answers
2k
views
Why can't my github app bypass branch protection
I want to create a github app in my organization that will allow me to create an automatic versioning commit directly on the main branch after every pull request is merged to main branch.
I have a ...
-1
votes
1
answer
88
views
Will deleting specific commits from a branch affect the original branch it was created from?
I have a branch A that was created from another branch B. Some specific commits from branch B are also present in branch A. I’m considering deleting those commits from branch A, but I’m concerned ...
0
votes
1
answer
71
views
Config file does not list newly created branch
I know there are 2 ways to create a branch. Remotely using a gui version control like GitHub or locally using git bash. When I create a new branch remotely and fetch the changes using git bash, the ...
1
vote
1
answer
159
views
Git branching strategy with GitHub Actions
I am trying to build the CI / CD for learning the Devops CI and CD flows with simple branching strategy.
Branch Strategy :
| branch name | environment |
main --> prod
release/* --&...
0
votes
0
answers
77
views
With git, how to minimize pain when switching between branches with differing .gitignores?
I am in a position where I switch branches in a single repo regularly, working on my own projects, and reviewing collaborator’s code by running it. Often new code will generate intermediary files that ...
0
votes
0
answers
51
views
Script to summarize relation between 4 types of git branches
I recently learned about the 4 types of git branches.
Conceptually, I kinda understand, but I'm writing a PowerShell script to get concrete understanding, and I have some questions. Script is ...
0
votes
0
answers
57
views
Is it possible to get the latest branch name for a git commit that is in several branches
I'm trying to get the branch name for a commit in git.
I'm using the following command:
git name-rev --name-only --always --exclude=tags* HEAD
but if the commit pointed by HEAD contains several ...
3
votes
1
answer
85
views
Git rebase multiple commits with multiple branches
I've got a git dag looking something like:
* commit A - main
|
| * commit B - branch1
| |
| * commit C - branch2
| |
| * commit D
|/
* commit E (this is the old main I worked on top of)
I ...
0
votes
1
answer
693
views
Why do I have to run "git branch --set-upstream-to=origin/<branch> local-branch-name" while doing git pull?
I am wondering why I have to git branch --set-upstream-to=origin/<branch> local-branch-name when doing git pull? Is there a way to keep the upstream the same as the current local branch of ...
-4
votes
1
answer
1k
views
How to create new branches from previous commits (using git bash)? [duplicate]
I made 6 commits on the master(main) branch, and I added a new branch which starts from the 2nd commit of master branch. But that was yesterday's work. Today, I want to make another brand new branch ...
-1
votes
1
answer
118
views
Is there a way to reset or remove all my commits into the dev branch?
I have been working on different branches and anytime task is ready I commit and create a pull request into the dev branch. Till now everything is okej, but is there a way to reverse or remove all ...
0
votes
0
answers
97
views
Is there a way to delete folders through GitLab from master branch, but keep them in other branches?
I'm sure this is a stupid question but I have very little background with git and everything I've learned has been done on the fly and independently, so I'm very much still learning.
I have a ...
-2
votes
1
answer
172
views
How do I make commit hash consumable on top of latest tag for go get command?
I'm working with the framework package (github.com/username/fmk) and I'm facing an issue with version resolution using go get.
Current Release Process:
Feature Branches: Developers create isolated ...
0
votes
1
answer
268
views
Right way to rename a directory with git
I have a project with its base directory named "MyProject". The repo is git managed. The main branch has the MyProject folder and some folders inside. I open a new branch "feature1"...
2
votes
0
answers
292
views
Branch protection rule is not allowing me to push changes in same branch second time in github
I created a branch feature/EAB-123 from the **test **branch using the following command:
git checkout -b feature/EAB-123 test
The branch was created successfully. I made changes, committed them, and ...
0
votes
2
answers
398
views
how to access remote branch locally?
I'm new to this Git and GitHub thing, and I'm having this confusion.
So, there are multiple people in my project, and they all work in their own branch (but we all work in the same file/module).
File
...
1
vote
2
answers
103
views
Git thinks branches have not been merged when they have
I'm trying to tidy up my local repo by deleting branches I no longer need.
I started by listing my merged merge requests in GitLab. Then I displayed the first one, got its branch name, and attempted ...
0
votes
2
answers
3k
views
How do I bring changes from a branch to another using IntelliJ?
I am pretty new to git. I wanted to create a project and I'm using IntelliJ to clone my repository. Unfortunately, IntelliJ has its own branch being created (called master). Now I want to submit my ...
-1
votes
1
answer
58
views
git branch -r --no-merged lists already merged branches
We keep our kickstart code in a git repository so it is consistent across all kickstart servers. We have a small script to display all current branches, ask which one you want to use and then pulls ...
0
votes
2
answers
97
views
Keeping diverging branches in sync with each other
I have two branches A and B which have diverged.
I want to periodically synchronize them with each other (commit most changes from B to A, and commit most changes from A to B).
When merging in either ...
0
votes
0
answers
53
views
When making a server copy, 'git remote show hub' returns with HEAD: (unknown)
I am using Sourcetree and PuTTY to try to make a server copy (according to this guide).
I have triple checked that all links are correct, all spelling is correct, and that the two empty and ...
0
votes
2
answers
166
views
Can I use two remotes with one local repo and use one of the remotes just to sync desktop and laptop?
I have a local git repo. I push and pull to a remote repo that I share with colleagues and don't want to push unfinished and untested changes.
I have a desktop and a laptop computer on which I want to ...
0
votes
4
answers
540
views
`git stash pop` confusion after `git stash -k` and changing the branch
I had a situation I don't really understand with git 2.26.2:
Implementing a new feature in a feature branch (say n-feature), I discovered two minor issues that should be fixed in the main branch (say ...
14
votes
2
answers
592
views
Xcode loses package dependencies when switching git branches
Since Xcode 15, every time my colleagues and I switch git branches (we do this a lot), Xcode seems to "lose" the package dependencies. If we don't notice it immediately, we notice as soon ...
0
votes
1
answer
453
views
Meaning of '+' symbol at the beginning of branch name in `git branch` output
I'm using git-subrepo. I've created a git subrepo branch and when I run git branch it outputs something like this:
$ git branch
* master
+ subrepo/CurriculumVitae
What's the meaning of that + symbol?
...
-2
votes
1
answer
53
views
Can I create another branch from one that's open from my main? [closed]
So I have a branch A open from my main/master branch. There's a different ticket from A that I need to work on, which overall like all tickets at the end gets merged into the master. Right now, I have ...
0
votes
0
answers
60
views
Git branch name sometimes displayed in-line in terminal affecting the actual code?
So, I am working on a local repository that was cloned from the company GitHub project page.
Some times, when I open the terminal in the GitHub directory, in-line in my command line, the active branch ...
1
vote
1
answer
45
views
Move committed changes from one file into new branch in git
I have a feature branch checked out from main with a few commits that edit various files in the codebase. However, I realize that in an upcoming PR, I don't want to incorporate changes to a specific ...
1
vote
2
answers
57
views
How do I move some modifications from a feature branch into the main one?
As title. I have created a branch to do specific tasks add-ui-components. Unfortunately, I also found some specific changes, let's call it upgrade-webpack-config, that I want to move out of the ...
0
votes
2
answers
193
views
Git log of a specific branch already merged
I'm trying to update a documentation script in Python, as my coworkers and I have recently started working with GIT.
The point I'm at and stuck with now is trying to extract a list of the names of ...
-7
votes
1
answer
196
views
Why my wsl ubuntu's default git branch is Master?
Whenever I use wsl to make any project and try to add project on git it shows the master as a default branch. But when I use windows to create project it shows main. I want to change the default ...
1
vote
2
answers
695
views
How to remove Git branches that give an error "does not point to a valid object"
I have a Git repository which contains a bunch of remote branches which no longer exist, but when I try to run git fetch -p I get an error:
error: refs/remotes/origin/bad/branch does not point to a ...
0
votes
1
answer
46
views
Git feature branch dragged on too long
I've been committing locally to a feature branch for weeks. About a dozen commits ago, I should have pushed to master and merged, but didn't realize that until now. My log looks like
* ba3c9f0 (HEAD ...
-2
votes
1
answer
905
views
To create a branch from a git tag is a good practice?
I have started working with a new dev team, and they have a practive that I can't find in git-book about branch management:
They use a single branch to centralize changes and close a tag for every ...