Re: [git-users] Clone thinks origin has a removed branch

2014-03-31 Thread Nelson Efrain A. Cruz
Hi, i think that prune it's what you are asking for, just like Konstantin
explain to you: it removes locals refs to remotes branches that no longer
exists, once they are removed they will not appear in your repo.


2014-03-31 1:19 GMT-03:00 Fredrik Linder fredrikelin...@gmail.com:


 'git remote prune origin' removes local branches -- that's not my issue
 :-) Thank you though.

 My issue is that my local repo (clone1) has an incorrect view of my remote
 (origin), and I don't know to fix that -- beside messing with the internals
 or re-cloning it.
 Besides, this happens regardless if I have a local branch tracking the
 remote branch or not.

 I thought 'git fetch' (or any of the other previously mentioned commands)
 was supposed to do that, but it doesn't.

 /Fredrik

 --
 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.




-- 
Nelson Efrain A. Cruz - https://plus.google.com/106845325502523605960/about

Debes ser el cambio que esperas ver en el mundo -Mahatma Gandhi

-- 
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] Clone thinks origin has a removed branch

2014-03-30 Thread Fredrik Linder

'git remote prune origin' removes local branches -- that's not my issue :-) 
Thank you though.

My issue is that my local repo (clone1) has an incorrect view of my remote 
(origin), and I don't know to fix that -- beside messing with the internals or 
re-cloning it.
Besides, this happens regardless if I have a local branch tracking the remote 
branch or not.

I thought 'git fetch' (or any of the other previously mentioned commands) was 
supposed to do that, but it doesn't.

/Fredrik

-- 
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] Clone thinks origin has a removed branch

2014-03-26 Thread Konstantin Khomoutov
On Tue, 25 Mar 2014 13:33:07 -0700 (PDT)
Fredrik Linder fredrikelin...@gmail.com wrote:

[...]
 *The another-branch is actually deleted from origin*
 *origin/master* git branch | grep 'another-branch' | wc -l
 0
 
 *Fetching the updated info from origin*
 *clone1/abranch* git fetch
 *clone1/abranch* git fetch --all
 *clone1/abranch* git push -f
 
 *My clone1 still thinks origin has the deleted branch*
 *clone1/abranch* git branch -r | grep 'origin/another-branch'
  origin/another-branch
 
 Neither git fetch, git fetch --all, git push -f nor git gc on either
 repo fixes this.

 Is this a bug or is there some other command to update clone1?

Supposedly you need to run

git remote prune origin

in your clone1 repo.

Of course, this is not a bug, you just have somewhat wrong mindset
possibly originated in centralised VC systems.  The idea is that any
repository (or, to be more down-to-earth, any your local repository)
is sacred and no history it contains is to be deleted on occasion;
only when you *explicitly* ask for this.

The reason is that after you have added another repository as a remote
and fetched branches for it (note that doing this automatically for
the remote named origin when you clone is just a convenience)
only you decide when you no longer need those bookmarks to that
repository's branches -- not whoever is able to push to that repository.
To better understand why this is needed consider that your local
repository might have literally dozens of remote repositories known to
it, and they are all managed by different people.  Suppose you added a
remote named hax0r to inspect a pull request from that coder, and
a remote branch hax0r/feature-foo got created in your repo; in the
meantime the used deleted that branch from his repo, but you're still
working with it -- should the next fetch from that repo pull the rug
under your feet?  Supposedly not.  But if you feel like it's okay to
remove that repo's stale branches you have a command to do that.

TL;DR
In the general case your normal local repository is not a dumb mirror of
the repo you cloned it from, -- it's a self-conscious repository with
its own bill of rights.  If you *do* want a dumb mirror, use a bare repo
and clone it with --mirror command-line option or use other means to
achieve the same effect.

-- 
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.