Questions tagged [git-branch]
git-branch is the Git command that manages branches.
git-branch
3,278
questions
0
votes
0
answers
10
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 ...
-2
votes
0
answers
24
views
Git - Sync main branch with develop
My develop branch is 2 commit behind Main branch. and I have to remove one unwanted code file from main branch so that main and develop will be same. what steps should I follow so that I cannot see ...
0
votes
0
answers
36
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 ...
2
votes
1
answer
31
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
37
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
36
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
0
answers
39
views
Issues connecting a local workspace to a GitHub repo and creating branches
I'm trying to connect a local workspace to an identical repository on GitHub. In this instance, I cannot use git clone so I'm trying to find a work-around. I seem to be able to set the remote url fine,...
-1
votes
1
answer
64
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
44
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
81
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
32
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
50
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
77
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
41
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
132
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 ...