Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working directory not respected by git-bash.exe #130

Closed
orgads opened this issue May 4, 2015 · 15 comments
Closed

Working directory not respected by git-bash.exe #130

orgads opened this issue May 4, 2015 · 15 comments

Comments

@orgads
Copy link

orgads commented May 4, 2015

Settings "Start in" for its shortcut has no effect.

@dscho
Copy link
Member

dscho commented May 4, 2015

Settings "Start in" for its shortcut has no effect.

As it should be: the Git Bash explicitly switches the working directory to your home directory (which makes most sense as a default, much more than starting the Git Bash in C:\Program Files\Git which would be the default otherwise).

You can pass a --cd=<directory> command-line option, though.

Anyway, I really consider this not a bug, but I would consider it a bug if Git Bash would respect the working directory that is the default. Remember: git-bash.exe should be double-clickable in a portable Git. There is no "Settings 'Start in'" for git-bash.exe that we could set to "user's home, please".

@dscho dscho closed this as completed May 4, 2015
@orgads
Copy link
Author

orgads commented May 4, 2015

Makes sense. Thanks for the fast response.

Is this flag documented anywhere?

@dscho
Copy link
Member

dscho commented May 4, 2015

Is this flag documented anywhere?

No, not yet. If you could take care of that, and of the --no-cd flag, I would be very thankful.

@orgads
Copy link
Author

orgads commented May 4, 2015

Where does it belong?

@dscho
Copy link
Member

dscho commented May 5, 2015

Ah. That is the question, isn't it? Let's rephrase it a little bit, though: Where would this information have crossed your eyes without having to search for it?

@orgads
Copy link
Author

orgads commented May 5, 2015

Release notes?

@dscho
Copy link
Member

dscho commented May 5, 2015

Sure!

@sukiletxe
Copy link

Hello,
I had the problem reported in the issue, and looked in the release notes just after being pointed out to them. Do you think it's worth it to document the --cd= and the --no-cd (I do)? If so, I'll open a pull request.
Thanks.

@dscho
Copy link
Member

dscho commented Jun 15, 2015

@sukiletxe excellent idea, go for it!

@sukiletxe
Copy link

I can't find the file to edit (the readme.portable shipped with the portable archive). I tried to search using some keywords and had no luck. Is the readme.portable added only in the release process? If so, and if I want to edit this file, should I put a copy in the repo?

@dscho
Copy link
Member

dscho commented Jun 15, 2015

I can't find the file to edit (the readme.portable shipped with the portable archive).

It is here: https://github.com/git-for-windows/build-extra/blob/master/portable/root/README.portable

Is the readme.portable added only in the release process?

Yes, and only as part of running https://github.com/git-for-windows/build-extra/blob/master/portable/release.sh

@sukiletxe
Copy link

Thanks for your response. That was completely my fault for not looking in the build-extra repo. Anyway, I've created a pull request, documenting --cd, --no-cd and HOME.

@dscho
Copy link
Member

dscho commented Jun 20, 2015

FWIW I made up my mind about git-bash.exe always switching directory and determined that my original reasoning was flawed: I wanted git-bash.exe in a portable Git to behave like the Git Bash start menu item of the non-portable version. But that is usually not what is needed! A most typical use case is for e.g. GitHub for Windows to start a Git Bash in a given working directory.

So I changed the behavior of git-bash.exe to require the new --cd-to-home option to behave like the Git Bash start menu item (which uses that option now). @sukiletxe may I ask you to adjust the README once more?

@sukiletxe
Copy link

Sure, but I don't quite understand what has exactly changed. Can you
please tell me what is the default now and what new option(s) have been
introduced?
Thanks.

@dscho
Copy link
Member

dscho commented Jun 20, 2015

The default is to not switch directory explicitly. If you want to switch to the home directory (as was the default of git-bash.exe before), you have to pass the --cd-to-home option.

sxlijin pushed a commit to sxlijin/build-extra that referenced this issue Feb 6, 2017
jeffhostetler added a commit to jeffhostetler/git that referenced this issue Mar 28, 2019
…tlink-in-coretxt

core.txt: fixup typo in gitlink for check-docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants