Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-1 votes
4 answers
96 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 ...
Nils's user avatar
  • 79
0 votes
1 answer
46 views

How to make Oh My Zsh display the output of `git branch` in a "normal" way? [duplicate]

On my Linux server when I use the git branch command it just displays the branches and the branch that I'm currently on. On my macOS when I use git branch it takes me to a separate window thing and I ...
Sean's user avatar
  • 3,385
0 votes
0 answers
29 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 ...
prosto.vint's user avatar
  • 1,495
0 votes
0 answers
27 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 ...
Kalyan's user avatar
  • 1
0 votes
0 answers
46 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 ...
halloleo's user avatar
  • 10.3k
1 vote
2 answers
75 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 ...
udance4ever's user avatar
1 vote
2 answers
316 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 ...
TheMemeMachine's user avatar
-1 votes
1 answer
73 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 ...
Sayki's user avatar
  • 3
0 votes
1 answer
60 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 ...
UnexpectedError's user avatar
0 votes
0 answers
72 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 ...
escapecharacter's user avatar
0 votes
0 answers
46 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 ...
joseville's user avatar
  • 943
0 votes
0 answers
48 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 ...
sagi's user avatar
  • 522
3 votes
1 answer
56 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 ...
beyarkay's user avatar
  • 1,003
0 votes
1 answer
115 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 ...
caot's user avatar
  • 3,318
-4 votes
1 answer
39 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 ...
Karthik's user avatar
-1 votes
1 answer
101 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 ...
Anxheloo's user avatar
0 votes
0 answers
64 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 ...
user25607012's user avatar
-2 votes
1 answer
123 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 ...
vignz.pie's user avatar
  • 199
0 votes
1 answer
88 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"...
KansaiRobot's user avatar
  • 9,786
2 votes
0 answers
120 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 ...
Vijay Mandanka's user avatar
0 votes
2 answers
128 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 ...
aki's user avatar
  • 49
1 vote
2 answers
60 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 ...
Jonathan Sachs's user avatar
0 votes
2 answers
864 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 ...
Lara's user avatar
  • 101
-1 votes
1 answer
56 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 ...
user2664304's user avatar
0 votes
2 answers
76 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 ...
Zachary Turner's user avatar
0 votes
0 answers
35 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 ...
Tori Hunter's user avatar
0 votes
2 answers
89 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 ...
shortwhile's user avatar
0 votes
0 answers
141 views

username.github.io is 404 not founded

Something wrong while I used Github to build my own blog by hexo. It was always successfully until after "hexo d". I suspect the problem was I changed the name of the initial branch in new ...
Sansui Luo's user avatar
0 votes
4 answers
216 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 ...
U. Windl's user avatar
  • 4,315
0 votes
1 answer
151 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? ...
Alberto López's user avatar
-2 votes
1 answer
51 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 ...
Linuxnoob's user avatar
0 votes
0 answers
52 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 ...
Nailtha's user avatar
1 vote
1 answer
40 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 ...
Andrew Mascillaro's user avatar
1 vote
2 answers
39 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 ...
NeoZoom.lua's user avatar
  • 2,819
0 votes
2 answers
133 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 ...
Alberto-HdF's user avatar
-7 votes
1 answer
137 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 ...
Arman Eousuf's user avatar
1 vote
2 answers
431 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 ...
MadScientist's user avatar
0 votes
1 answer
45 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 ...
dpm's user avatar
  • 1
-2 votes
1 answer
411 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 ...
felipe_dmz's user avatar
0 votes
1 answer
88 views

Is it safe to rebase remote branch if nobody based work on it? [duplicate]

I want push my personal local branch for code review with my peer. My peer doesn't will merge this branch. After code review, I want rebase my personal branch in master branch, and push master branch. ...
Alisson's user avatar
1 vote
2 answers
715 views

Is there a way to restrict branch creation pattern in github?

I have a main branch and if someone wants to create new branch then it must start with feature/*, bugfix/*, release/*. I tried using branch protection rules, but I couldn't find any settings that ...
Ainz's user avatar
  • 21
0 votes
0 answers
71 views

Git rebase to squash commits reverts local to several commits prior

I made a few commits to my branch and then merged it into master with a CR. I want all the commits to that branch to be squashed, so I tried git rebase -i HEAD~3 and squashed the two most recent ...
Kevin2566's user avatar
  • 433
0 votes
1 answer
40 views

Are commits from local branches that aren't pushed accessible at the remote?

Say I have the following scenario: Currently on master, do git checkout -b test. Make some commits A and B in test. Go back to master with git checkout master. Make some commits C and D, then push to ...
Inertial Ignorance's user avatar
1 vote
2 answers
224 views

I received Pull Request in GitHub from contributor. But I'd like to make some changes to it. How to do that and still give him credit when merging?

I received a Pull Request for my GitHub repo from a fellow contributor. But I would like to make some changes to it before merging. It is not clear to me how to do that and then still merge under his ...
CristalDurman's user avatar
1 vote
1 answer
71 views

Git Submodule Changing Branch - unexpected behaviour

I want to pull in a great library from github into my code. As an minimum example, I'll create a new git repo so you can follow along! I arrived here because I wanted to change the branch of the ...
monkey's user avatar
  • 1,585
-2 votes
2 answers
139 views

Why doesn't git branch command show any branches?

Few months ago I was going through a tutorial teaching git. There was the main branch (obviously) and then I created a second branch. Now I'm back at learning git and when I try to see the branches ...
JustLearn's user avatar
  • 119
0 votes
0 answers
41 views

Git hub branch structure and PR flow

I am a developer working in a team of 8-9 people. We have issues while raising PRs. We have 2 branches. One for Dev and One for Prod (main). Whenever we need to develop a feature, We are creating a ...
pandu ranga's user avatar
0 votes
1 answer
597 views

How to Git clone and fetch all branches from a GitHub repository to my local machine? [duplicate]

I'm trying to clone all branches from a GitHub repository to my local machine using Git. I want to have local copies of all branches, not just the default branch. I've tried the following commands: ...
MD Abdur Rahim's user avatar
0 votes
0 answers
85 views

How do I recover a branch which I deleted both the local and the GitHub version of it and changed the default branch?

Okay so I somehow mixed up my branches while trying to fix them, and ended up deleting the one I wanted both locally and in GitHub. It all started when I was taught that I could use git.ignore to get ...
classyname's user avatar
0 votes
0 answers
47 views

Cannot Merge GIT branch [duplicate]

I have on the branch dev and I created new branch from this branch with git checkout -b dev3 and I do some modification on this dev3 branch. After commit I merge it again to dev branch so I go back to ...
naticap's user avatar
  • 397

1
2 3 4 5
62