git glob pattern in .gitignore and git command

2018-06-02 Thread Yubin Ruan
To ignore all .js file under a directory `lib', I can use "lib/**/js" to match them. But when using git command such as "git add", using "git add lib/\*.js" is sufficient. Why is this difference in glob mode? I have heard that there are many different glob mode out there (e.g., bash has many

[RFC] git clone add option to track all remote branches

2018-04-01 Thread Yubin Ruan
Hi, I am writing to ask that whether or not you think will be appropriate to add an option to "git clone" so that whenever a repo is cloned, branches are created automatically to track corresponding remote branches. (or is there any equivelant option?) You can obviously do this by a bash command

Re: Draft of Git Rev News edition 33

2017-11-20 Thread Yubin Ruan
2017-11-20 16:33 GMT+08:00 Christian Couder : > Hi, > > A draft of a new Git Rev News edition is available here: > > > https://github.com/git/git.github.io/blob/master/rev_news/drafts/edition-33.md > > Everyone is welcome to contribute in any section either by

Re: Meaning of two commit-ish hash in git diff

2017-10-31 Thread Yubin Ruan
Thanks Philip, On 11/01/2017 08:27 AM, Philip Oakley wrote: > Yubin , > > From: "Junio C Hamano" <gits...@pobox.com> >> Yubin Ruan <ablacktsh...@gmail.com> writes: >> >>> diff --git a/path/somefile b/path/somefile >>> index f8886b4..a

Meaning of two commit-ish hash in git diff

2017-10-30 Thread Yubin Ruan
Hi, Can anyone tell me what does the "f8886b4..a1c96df" mean in a git diff output, as below? diff --git a/path/somefile b/path/somefile index f8886b4..a1c96df 100644 --- a/path/somefile +++ b/path/somefile This is output by a `git diff` between two adjacent commits but they are not any commit

checking out from branch A to branch B brings along a folder from A. Why

2017-10-23 Thread Yubin Ruan
Hi, I got three branch: master, A, B. I have a directory in branch A: "/path/to/repo/somefolder" (and that folder is in the working tree, not working directory), but that folder doesn't exist in either branch B or master. When in branch A, if I do $ git checkout B that "somefolder" will be

Re: will git rebase has side effect

2017-10-01 Thread Yubin Ruan
2017-10-01 22:17 GMT+08:00 Kevin Daudt <m...@ikke.info>: > Forgot to cc the mailing list. > > On Sun, Oct 01, 2017 at 09:23:23PM +0800, Yubin Ruan wrote: >> Suppose that I have such a history of commit locally: >> >> A --> B --> C --> D >> >>

will git rebase has side effect

2017-10-01 Thread Yubin Ruan
Suppose that I have such a history of commit locally: A --> B --> C --> D If I then add a few more commits locally A --> B --> C --> D --> E --> F --> G And then I do a rebase and squash F and G into one single commit H. What side effect will this rebase have? How will this affect "git push

Re: git diff doesn't quite work as documented?

2017-09-09 Thread Yubin Ruan
2017-09-08 0:31 GMT+08:00 Olaf Klischat : > oklischat@oklischat:/tmp$ mkdir gittest > oklischat@oklischat:/tmp$ cd gittest/ > oklischat@oklischat:/tmp/gittest$ git init > Initialized empty Git repository in /private/tmp/gittest/.git/ > oklischat@oklischat:/tmp/gittest$

Re: [RFC] Add warning when git discard changes on another branch?

2017-05-08 Thread Yubin Ruan
On Mon, May 08, 2017 at 03:07:02PM +0900, Junio C Hamano wrote: > Yubin Ruan <ablacktsh...@gmail.com> writes: > > > That would be helpful. But, frankly, if a user would be aware of that > > `advice.*' > > variable, he would have enough knowledge of Git to be aware

Re: [RFC] Add warning when git discard changes on another branch?

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 01:19:58PM +0900, Junio C Hamano wrote: > Junio C Hamano writes: > > > But to help "some users are not aware of this" situation, an opt-in > > "feature" would not help all that much. The same number of lines in > > the documentation to tell end-users

Re: [RFC] Add warning when git discard changes on another branch?

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 12:41:03PM +0900, Junio C Hamano wrote: > Yubin Ruan <ablacktsh...@gmail.com> writes: > > > I understand this. I just suggest that git add some warning in case some > > users > > are not aware of this, as it does when , on branch 'iss

Re: [RFC] Add warning when git discard changes on another branch?

2017-05-07 Thread Yubin Ruan
On Mon, May 08, 2017 at 12:05:31PM +0900, Junio C Hamano wrote: > Yubin Ruan <ablacktsh...@gmail.com> writes: > > > I think it would be better if git can warn use if we switch to another > > branch > > without committing the modification. Git will warn if

[RFC] Add warning when git discard changes on another branch?

2017-05-07 Thread Yubin Ruan
Hi, I think it would be better if git can warn use if we switch to another branch without committing the modification. Git will warn if the modification is based on a commit different from where the checkout happened. For example, say I am now on branch 'master' and all files *clean*. Now if I