Linked Questions

15 votes
3 answers
13k views

What's the use case for "git branch -d"

I was helping out a co-worker today, and discovered that git branch -D and git branch -d do slightly different things. From the git help documentation: -d --delete delete fully merged branch -D ...
joshin4colours's user avatar
18 votes
2 answers
15k views

List and delete git branches without cloning

for k in $(git branch -r --merged origin/master | cut -d" " -f 3); do echo $k done I have a list of git projects that i want to clean up old branches in, what i want to do is list and delete all ...
A.Jac's user avatar
  • 1,543
17 votes
3 answers
14k views

How do you merge changes on non-master branches from a forked github repository?

In both of the following StackOverflow questions, the accepted answer describes how to merge changes from a forked repository in the situation where you fork a repo, the original repo is modified, and ...
Matthew Rankin's user avatar
18 votes
2 answers
13k views

Remove a single merged branch from master branch

In my master branch, there're following local branches that have been merged, but I would like to remove the local_branch3 from master: local_branch1 local_branch2 local_branch3 local_branch4 after ...
TonyW's user avatar
  • 18.7k
15 votes
2 answers
7k views

How to forcefully delete a remote branch in GitHub?

I have 2 remote branches : - pending-issues-in-project - new-issues-in-project I tried to delete pending-issues-in-project like this : git push origin :pending-issues-in-project, but i got the ...
Arpit Rawat's user avatar
  • 1,827
17 votes
3 answers
6k views

What happens to a git branch after delete if it was not merged?

I have a small repo with a master and an experimental branch for trying out some new features. I decided not to implement those features on the master. What happens to the commits of the ...
inf3rno's user avatar
  • 25.5k
21 votes
5 answers
13k views

Github release a specific folder

I have a repository that has a bunch of folders, but I want to create releases for just one of those folders. Simpler story, it's for a gaming server, and I just want to create releases for the ...
crosenblum's user avatar
  • 1,937
12 votes
1 answer
11k views

delete remote branch origin

I deleted a branch with : git branch -d branch_name And I pushed, but when I list the branches with : git branch -avv I see that the branch is always present with the name remotes/origin/...
Brahim LAMJAGUAR's user avatar
17 votes
1 answer
19k views

Guidance on main and master branch in github

I had created a remote repository in Github and pushed my project into that remote repository. After pushing it, a new branch is created master and now I have two branches main and master. The default ...
Subrato Pattanaik's user avatar
11 votes
1 answer
6k views

What does this mean from a security perspective: "Caution: This repository is private but the published site will be public."

I've got a repo that will contain sensitive information, so in GitHub I made it private. After doing so, however, this message is now displayed: Caution: This repository is private but the published ...
M. Smith's user avatar
  • 365
11 votes
2 answers
6k views

Git: How to properly merge two functional and quite different branches?

Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches ...
jayarjo's user avatar
  • 16.5k
8 votes
3 answers
10k views

My Github repo has 'main' and 'master' branches - what is their purpose?

I was trying to push some local unversioned code into a repo and get it up onto GitHub for accessibility reasons. I followed the suggestions here cd <local_dir> git init git add . git commit -m &...
Feargal Hogan's user avatar
14 votes
2 answers
6k views

How do you remove a branch and all of its history locally and remotely?

I have a git branch I need to nuke all traces of. I think I need something like git filter-branch --index-filter 'git -D <branch>' --tag-name-filter cat -- --all or maybe git filter-branch --...
drs's user avatar
  • 5,749
2 votes
3 answers
11k views

Git branch still exists after deleting locally and remotely

I have a development branch called Atomics (more correctly, atomics). Its finished being developed. It tested OK, so it was merged into Master. I'm now ready to completely delete it since its no ...
jww's user avatar
  • 100k
6 votes
1 answer
4k views

'git branch -a' still showing deleted remote branch in the remote repo?

I have uploaded (pushed the entire local branch) to the remote repo. I have merged it with master and deleted it in the remote repo (on github.com) Running git branch -a still shows it in the console:...
ERJAN's user avatar
  • 24.2k

15 30 50 per page
1
…
3 4
5
6 7
…
12