Re: [git-users] Help with git pull, and restricting what gets pulled

2017-04-27 Thread Igor Djordjevic
Hi Michael,

On Thursday, April 27, 2017 at 1:42:18 AM UTC+2, Michael Gersten wrote:
>
> Thank you very much.
>

No problem, glad if it helped :)


When I said 
> >   843  git fetch origin refs/pull/12121/head 
> I was under the impression that explicitly fetching a specific branch also 
> set up a tracking branch for it. 
>
> I was not aware that I had to say --track
>

In some general use, you don`t even have to say `--track` nowadays, if you 
try to checkout a branch that does not exist, but Git finds a remote branch 
of the same name, it will be smart and create a new local branch with that 
name for you, setting it to track the remote branch automatically.

For example, in a case like this:

$ git branch --all
* master
  remotes/gkoelln/Dish
  remotes/origin/master

... you can just do (note that local branch "Dish" doesn`t even exist yet):

$ git checkout Dish

... and you`ll get your local remote tracking branch automatically:

Switched to a new branch 'Dish'
Branch Dish set up to track remote branch Dish from gkoelln.


However, in your specific case with "pull request branches" this doesn`t 
seem to work as automatically - maybe because of the "special nature" of 
those pull request "branches" (residing inside "refs/pull/", instead of 
"refs/heads/", on the remote side)...? Not really sure. Yet, `--track` gets 
the job done ;)

Regards,
Buga

-- 
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] Help with git pull, and restricting what gets pulled

2017-04-26 Thread Michael
Thank you very much.

> Where did you "explicitly ask for pull request 12121" remote tracking branch, 
> in order for it to be shown here? I haven`t seen that command in your e-mail, 
> so unless you accidentally omitted it, you didn`t actually ask for it... yet.

When I said
>   843  git fetch origin refs/pull/12121/head 
I was under the impression that explicitly fetching a specific branch also set 
up a tracking branch for it.

I was not aware that I had to say --track

---
Entertaining minecraft videos
http://YouTube.com/keybounce

-- 
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] Help with git pull, and restricting what gets pulled

2017-04-26 Thread Michael
So I'm having a "too much pulled" issue, that I'd like help with.

I'm working with this remote:

[remote "origin"]
url = https://github.com/rg3/youtube-dl.git
fetch = +refs/heads/*:refs/remotes/origin/*


I wanted to be able to get pull requests to test and play with, and I was told 
to add this line:

fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

Which worked -- I was able to say
  843  git fetch origin refs/pull/12121/head

No problem.

What was the problem? Doing an update.

keybounceMBP:youtube-dl michael$ git pull master
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
keybounceMBP:youtube-dl michael$ git pull
remote: Counting objects: 17909, done.
remote: Compressing objects: 100% (112/112), done.
remote: Total 17909 (delta 10124), reused 10079 (delta 10078), pack-reused 7717
Receiving objects: 100% (17909/17909), 74.44 MiB | 3.01 MiB/s, done.
Resolving deltas: 100% (12988/12988), completed with 3257 local objects.
>From https://github.com/rg3/youtube-dl
   629dc1892..b876a9cd7  gh-pages -> origin/gh-pages
   a4d6cf970..3dc8b61b7  master   -> origin/master
 * [new ref] refs/pull/0/head -> origin/pr/0
 * [new ref] refs/pull/100/head   -> origin/pr/100
 * [new ref] refs/pull/10011/head -> origin/pr/10011
 * [new ref] refs/pull/10012/head -> origin/pr/10012
...

So, instead of updating master, like I thought, or just the one pull request I 
had previously gotten (NB: those would be the only refs I had from that 
github), I now have lots and lots of things I don't care about or want.

My first question is, if I just delete the files from 
.git/refs/remotes/origin/pr/ that I don't want, will that result in git 
cleaning up the unwanted branches?

My second question is: The only way I could manage to update master was:

keybounceMBP:youtube-dl michael$ git fetch origin master
>From https://github.com/rg3/youtube-dl
 * branchmaster -> FETCH_HEAD
keybounceMBP:youtube-dl michael$ git checkout master
Switched to branch 'master'
Your branch is behind 'origin/master' by 12 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
keybounceMBP:youtube-dl michael$ git pull
Updating a4d6cf970..3dc8b61b7
Fast-forward
 .github/ISSUE_TEMPLATE.md |   6 ++---

...

So, what is the proper/best usage of fetch/pull? At the moment, I'm interested 
in these branches:
origin master
origin refs/pull/12121
gkoelln Dish

And, while I did explicitly ask for pull request 12121, it did not show up in 
my remotes --
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "Dish"]
remote = gkoelln
merge = refs/heads/Dish

so what do I need to do to tell git that this is something I'm interested in?

(I can be 99% certain that I'll be adding some other pull request to this 
octopus at some point :-)

---
Entertaining minecraft videos
http://YouTube.com/keybounce

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