From: Sivanandan Srilakshmanan <ssrilaks@gmail.com>
To: Pratyush Yadav <me@yadavpratyush.com>
Cc: git@vger.kernel.org
Subject: Re: working directory status
Date: Sun, 17 Nov 2019 22:07:45 +1100 [thread overview]
Message-ID: <CACKP9cs+eJMtwWJtc3c_TXOUacpaxHUP4Ugw5oSpDfKcABaR7g@mail.gmail.com> (raw)
In-Reply-To: <20191117072942.cycm2kyvt2g2bhaz@yadavpratyush.com>
Hi Pratyush,
Thank you so so so very much for responding quickly. I am learning git
to assist my teams skill up on git.
My current version is v2.23.0 which I downloaded and installed a month
ago. Nevertheless, I have downloaded and installed v2.24.0 and the
problem still persists.
I have the following environment variable set
GIT_DIR=C:\GitRepo
GIT_HOME=C:\tools\Git
Please find below output from my command.
C:\test\Local_Newfeature>git branch
* Local_Kumfeature_branch
Local_MyTest_branch
+ Local_Newfeature_branch
+ Local_SGSfeature_branch
Local_feature_branch
C:\test\Local_Newfeature>git worktree list
C:\GitRepo (bare)
C:/test/Local_Kumfeature b0a097e [Local_Kumfeature_branch]
C:/test/Local_Newfeature b0a097e [Local_Newfeature_branch]
C:/test/Local_SGSfeature b0a097e [Local_SGSfeature_branch]
C:\test\Local_Newfeature>git --work-tree=C:\test\Local_Newfeature status
On branch Local_Kumfeature_branch
Your branch is up to date with 'Lakshman/feature_branch'.
nothing to commit, working tree clean
Your assistance is greatly appreciated.
Thanks
Lakshman
On Sun, Nov 17, 2019 at 6:29 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
>
> On 17/11/19 11:55AM, Sivanandan Srilakshmanan wrote:
> > Hi,
> >
> > I am new to git. I have been reading the documentation on Pro Git.
> >
> > I have checked out two working directory (test1 & test2) using the
> > "git worktree add --checkout" command.
> >
> > When I run the "git status" in either (test1 or test2) on the checked
> > out folder, the "On branch <branch name>" displays the branch name
> > from the latest checkout (ie branch associated with test2).
>
> This behaviour does not happen for me on Git v2.24.0. When I create
> multiple worktrees, 'git status' in each worktree directory shows the
> correct branch. What version of Git are you using?
>
> > Could you please provide the correct syntax to display the branch name
> > associated with the respective folder.
>
> You can use 'git worktree list' to see a list of all the worktrees. The
> output of the list has 3 columns: path to the worktree, commit checked
> out, and the name of the branch checked out in that worktree.
>
> Example output:
>
> $ git worktree list
> /home/pratyush/src/git 50b2267a2a [next]
> /home/pratyush/src/foo 50b2267a2a [foo]
>
> The first worktree is in ~/src/git and has the branch 'next' checked
> out. The second is in ~/src/foo and has the branch 'foo' checked out.
>
> That said, running 'git status' should still show you the correct branch
> name. Try updating Git to the latest version (v2.24.0), and try again.
>
> --
> Regards,
> Pratyush Yadav
next prev parent reply other threads:[~2019-11-17 11:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-17 0:55 working directory status Sivanandan Srilakshmanan
2019-11-17 7:29 ` Pratyush Yadav
2019-11-17 11:07 ` Sivanandan Srilakshmanan [this message]
2019-11-17 12:30 ` Johannes Sixt
2019-11-17 20:33 ` Sivanandan Srilakshmanan
2019-11-17 22:26 ` Johannes Sixt
2019-11-18 4:32 ` Sivanandan Srilakshmanan
2019-11-18 6:51 ` Johannes Sixt
2019-11-18 7:01 ` Eric Sunshine
2019-11-18 7:12 ` Junio C Hamano
2019-11-18 10:40 ` Sivanandan Srilakshmanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACKP9cs+eJMtwWJtc3c_TXOUacpaxHUP4Ugw5oSpDfKcABaR7g@mail.gmail.com \
--to=ssrilaks@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@yadavpratyush.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).