Re: How to specify remote branch correctly

2012-12-16 Thread Woody Wu
On 2012-12-17, Tomas Carnecky wrote: > On Mon, 17 Dec 2012 07:02:46 +, Woody Wu wrote: >> On 2012-12-17, Tomas Carnecky wrote: >> > 'git checkout foo' has special meaning if a local branch with that >> > name doesn't exist but there is a remote branch with that name. In >> > that case it's e

Re: How to specify remote branch correctly

2012-12-16 Thread Tomas Carnecky
On Mon, 17 Dec 2012 07:02:46 +, Woody Wu wrote: > On 2012-12-17, Tomas Carnecky wrote: > > 'git checkout foo' has special meaning if a local branch with that > > name doesn't exist but there is a remote branch with that name. In > > that case it's equivalent to: git checkout -t -b foo origin/

Re: How to specify remote branch correctly

2012-12-16 Thread Woody Wu
On 2012-12-17, Tomas Carnecky wrote: > On Mon, 17 Dec 2012 16:13:08 +1100, Andrew Ardill > wrote: >> On 17 December 2012 16:06, Woody Wu wrote: >> > 1. git checkout foo. By this command, I think I am checking out >> > files in my local branch named foo, and after that I also switch to >> > the

Re: How to specify remote branch correctly

2012-12-16 Thread Woody Wu
On 2012-12-17, Andrew Ardill wrote: > On 17 December 2012 16:06, Woody Wu wrote: >> 1. git checkout foo. >> By this command, I think I am checking out files in my local branch >> named foo, and after that I also switch to the branch. Right? > > Correct. Your working directory (files) switch over

Re: How to specify remote branch correctly

2012-12-16 Thread Chris Rorvick
On Sun, Dec 16, 2012 at 11:52 PM, Andrew Ardill wrote: > This is true, but I don't think it is documented. I noticed this, too. I was just about to send a patch to add this. Chris -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel

Re: How to specify remote branch correctly

2012-12-16 Thread Andrew Ardill
On 17 December 2012 16:30, Tomas Carnecky wrote: > 'git checkout foo' has special meaning if a local branch with that name > doesn't exist but there is a remote branch with that name. In that case it's > equivalent to: git checkout -t -b foo origin/foo. Because that's what people > usually want.

Re: How to specify remote branch correctly

2012-12-16 Thread Tomas Carnecky
On Mon, 17 Dec 2012 16:13:08 +1100, Andrew Ardill wrote: > On 17 December 2012 16:06, Woody Wu wrote: > > 1. git checkout foo. > > By this command, I think I am checking out files in my local branch > > named foo, and after that I also switch to the branch. Right? > > Correct. Your working dire

Re: How to specify remote branch correctly

2012-12-16 Thread Andrew Ardill
On 17 December 2012 16:06, Woody Wu wrote: > 1. git checkout foo. > By this command, I think I am checking out files in my local branch > named foo, and after that I also switch to the branch. Right? Correct. Your working directory (files) switch over to whatever your local branch 'foo' points to

Re: How to specify remote branch correctly

2012-12-16 Thread Woody Wu
On 2012-12-17, Andrew Ardill wrote: > On 17 December 2012 13:30, Woody Wu wrote: >> 1. git checkout foo >> 2. git checkout origin/foo >> >> The first method run silently with success, but the second method >> complains that I got a 'detached HEAD'. So, I think I don't understand >> the differenc

Re: How to specify remote branch correctly

2012-12-16 Thread Andrew Ardill
On 17 December 2012 13:30, Woody Wu wrote: > 1. git checkout foo > 2. git checkout origin/foo > > The first method run silently with success, but the second method > complains that I got a 'detached HEAD'. So, I think I don't understand > the difference between 'foo' and 'origin/foo'. Can someon

How to specify remote branch correctly

2012-12-16 Thread Woody Wu
Hi, List I have two branches in the remote, say, origin/master, origin/foo. Then when I tried to switch to the remote foo branch, the following two methods gave me different results: 1. git checkout foo 2. git checkout origin/foo The first method run silently with success, but the second method