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

smithy init. throws error "Unable to run git fetch --depth 1: fatal: not a git repository (or any of the parent directories): .git" #2493

Open
purnasrivatsa96 opened this issue Dec 24, 2024 · 7 comments
Labels
needs-reproduction This issue needs reproduction.

Comments

@purnasrivatsa96
Copy link

This happens despite being in a git repo.

Version 1.53.0

@JordonPhillips
Copy link
Contributor

Can you give more details about what you are doing? For example, exact commands and a reproduceable environment? The following works just fine for instance:

> mkdir /tmp/smithy-init-test
> cd /tmp/smithy-init-test
> git init .
> smithy init .

@JordonPhillips JordonPhillips added the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days. label Dec 27, 2024
@purnasrivatsa96
Copy link
Author

purnasrivatsa96 commented Jan 12, 2025

Just running the first command in the public tutorial guide -
https://smithy.io/2.0/tutorials/full-stack-tutorial.html

smithy init -t full-stack-application

was giving -

"Unable to run git fetch --depth 1: fatal: not a git repository (or any of the parent directories): .git

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days. label Jan 13, 2025
@sugmanue
Copy link
Contributor

I just ran that command without any issues, can you please let us know which version of the Smithy CLI are you using? (output of smithy --version)

@sugmanue sugmanue added needs-reproduction This issue needs reproduction. closing-soon This issue will automatically close in 7 days unless further comments are made. labels Jan 22, 2025
@purnasrivatsa96
Copy link
Author

1.53.0

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 7 days unless further comments are made. label Jan 26, 2025
@purnasrivatsa96
Copy link
Author

Hi any resolution to this ?

> mkdir /tmp/smithy-init-test
> cd /tmp/smithy-init-test
> git init .
> smithy init .

Tried all of this and the last one gives -
Unable to run git fetch --depth 1: fatal: not a git repository (or any of the parent directories): .git

@kstich
Copy link
Contributor

kstich commented Feb 17, 2025

If this is failing when trying to fetch, the git init . has failed in some way. The .git directory is created as part of that command.

@purnasrivatsa96
Copy link
Author

(base) purnasrivatsa@Purnas-MacBook-Air quickstart-java % mkdir /tmp/smithy-init-test
(base) purnasrivatsa@Purnas-MacBook-Air quickstart-java % cd /tmp/smithy-init-test
(base) purnasrivatsa@Purnas-MacBook-Air smithy-init-test % git init .
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
Initialized empty Git repository in /private/tmp/smithy-init-test/.git/
(base) purnasrivatsa@Purnas-MacBook-Air smithy-init-test % git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)
(base) purnasrivatsa@Purnas-MacBook-Air smithy-init-test % git branch
(base) purnasrivatsa@Purnas-MacBook-Air smithy-init-test % ls -la
total 0
.
.
.
drwxr-xr-x   9 purnasrivatsa  wheel  288 Feb 17 23:14 .git
(base) purnasrivatsa@Purnas-MacBook-Air smithy-init-test % smithy init .
Unable to run `git fetch --depth 1`: fatal: not a git repository (or any of the parent directories): .git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-reproduction This issue needs reproduction.
Projects
None yet
Development

No branches or pull requests

4 participants