[git-users] error deleting branch after merging with squash

2019-03-31 Thread dmgf
I upgraded my rails application in a dedicated `upgrading` branch, made two 
commits, then checkout to the master branch and merged with --squash option:

$ git checkout -b upgrading
$ git add -A
$ git commit -m 'before rails app update'
$ rails app:update
$ git add -A
$ git commit -m "work in progress"
$ git checkout master
$ git merge --squash upgrading
$ git commit -m "upgrade to Rails 5.1.6"

When I tried to delete my `upgrading` branch, git did not proceed with the 
deletion for the following reason:

$ git branch -d upgrading
error: The branch 'upgrading' is not fully merged.
If you are sure you want to delete it, run 'git branch -D upgrading'.

Why is happening this?
I found a Stackoverflow topic  
on the same issue: what I would like to know is if this happens every time 
there is a merge with --squash option, so that I can safely remove the 
topic branch using the -D option.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] remote and remote-tracking branches

2016-03-04 Thread dmgf


On Friday, March 4, 2016 at 12:29:58 PM UTC+1, Konstantin Khomoutov wrote:
>
>
> It depends.  If you really want to wipe out any mentions of that branch, 
> the third command is necessary too: the way remote-tracking branches 
> work is somewhat asymmetrical to normal branches in that if a branch is 
> deleted in a remote repo you're tracking, the next `git fetch` against 
> that remote repo won't delete the matching remote-tracking branch. 
> So there are two ways to deal with such branches: one is that you 
> presented and another one is `git remote prune ` which 
> would reach for the identified remote repo, grab the list of branches 
> it has and make sure all your remote-tracking branches for that remote 
> which no longer exist there are deleted. 
>

I understand that the two commands do the same job with a substantial 
difference:
git branch -dr origin/topic-branch can be used when there is only one 
remote-tracking branch to be deleted, while git remote prune  has 
to be used when there is more than one remote-tracking branch, unless I 
wanted to clean up the references one by one.
I take for granted that your command should be used as git remote prune 
origin and not git remote prune origin/topic-branch, and that should be 
called after git branch -d topic-branch and git push origin --delete 
topic-branch.

I also found git fetch --prune at stackoverflow 
probably
 
to be used as git fetch origin --prune.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] remote and remote-tracking branches

2016-03-04 Thread dmgf
Are they different objects?
In the Git user manual 
 it is written 
that "your local repository keeps branches which track each of those remote 
branches, called remote-tracking branches, which you can view using the -r 
option to git-branch.

Overall If I am not wrong there should be local branches and 
remote-tracking branches in my local repository, and remote branches at 
BitBucket or GitHub for instance.

I usually create a topic/feature branch with: git checkout -b topic-branch
I work on it and push it from time to time to BitBucket with: git push -u 
origin topic-branch
Then when I finished I merge topic-branch to master and push it to BitBucket

If in the end the work on my new feature was completed I would probably 
want to remove my local and remote topic-branch.
What then am I supposed to do? Delete only my local and remote branch or 
also my remote-tracking branch?

In other words, I should use all the following three commands:

git branch -d topic-branch
git push origin --delete topic-branch
git branch -dr origin/topic-branch


or only two of them are necessary?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.