Questions tagged [git-init]

Create an empty Git repository or reinitialize an existing one.

55 questions
1653
votes
15 answers

How to fully delete a git repository created with init?

I created a git repository with git init. I'd like to delete it entirely and init a new one.
user105813
  • 17,059
  • 4
  • 21
  • 17
965
votes
6 answers

Is there a command to undo git init?

I just Git init'ed a repos with a wrong user, and want to undo it. Is there any command for this? Do I actually have to go in and edit the .git directory?
Yarin
  • 173,523
  • 149
  • 402
  • 512
13
votes
4 answers

git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository

I am using macOS Catalina. I already have a repository on GitLab and an SSH-key assigned. Now I want to create another repository from the terminal. I do the following: git config user.name my_name git config user.email my_email git init Then I get…
beliz
  • 402
  • 1
  • 5
  • 25
10
votes
9 answers

git init will not create git directories for me

I am new to Git. I can get a Git directory structure in a bare directory with git -init --bare. I can see where the git information is stored. However, when I try to use git init or even git clone, I never see any .git subdirectory in my local…
jmknpk
  • 123
  • 1
  • 1
  • 6
9
votes
5 answers

Gitkraken: Failed initializing Git Flow

I am using Gitkraken to manage my git activities but while initializing Git Flow using inbuilt option provided by Gitkraken it fails. Here is the screenshot that shows the error message
Varun Sukheja
  • 6,170
  • 5
  • 51
  • 93
8
votes
1 answer

Git error "fatal: GIT_WORK_TREE (or --work-tree=) not allowed without specifying GIT_DIR (or --git-dir=)"

I have GIT_WORK_TREE set to . and GIT_DIR set to .git. When I run git init --bare, I get the following error: fatal: GIT_WORK_TREE (or --work-tree=) not allowed without specifying GIT_DIR (or --git-dir=) What's up with that?…
joshlf
  • 21,822
  • 11
  • 69
  • 96
7
votes
3 answers

How to add an existing nested repo (already checked out in a subdir) to a parent Git repo as a submodule?

What happens if I'm creating the initial commit from my working (parent) directory, but there are subdirs with independently checked-out git repos? I simply did git add . but that brought me to a strange situation when the subdirs with nested Git…
imz -- Ivan Zakharyaschev
  • 4,921
  • 6
  • 53
  • 104
4
votes
3 answers

Create an empty Git repository with branch name as prod

I would like to create a new git repository using git init command with branch name as prod. I searched all options supported by git init command in this documentation to override the default branch name master. Unfortunately, there's no such…
user6077173
4
votes
2 answers

Git Clone Repo Has No .git File

I cloned a repo with git clone but when I run git status I get the fatal: not a git repository error. What I want to know is, if I run git init in the local directory that was cloned, will it screw anything up or cause issues with the…
FrankDraws
  • 385
  • 1
  • 6
  • 21
3
votes
1 answer

Why does "rails new my_app" initialize a git repository?

When I run the Ruby on Rails command rails new my_app, it creates the new my_app directory, and it contains a .git subdirectory, i.e., ./my_app/.git, so it's apparently doing a git init. Where is that git init command coming from, and why does it…
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
3
votes
1 answer

Issue on git repository creation and accessibility using git

I had created created repository in UNIX machine, $sudo git --bare init /var/repos/git/repo00001 Also I have done following commands executed for individual UNIX users, $ git config --global user.email "MyfullName@mindtree.com" $ git config --global…
Dev Anand Sadasivam
  • 699
  • 7
  • 21
  • 49
3
votes
1 answer

What does 'reinitialize' mean/actually do in git?

I found a related question below, but can't understand 'pick up newly added templates', and seems this explaination was removed in latest http://git-scm.com/docs/git-init Does running git init twice initialize a repository or reinitialize an…
user3620613
  • 151
  • 1
  • 7
2
votes
2 answers

"Reinitialized existing Git repository" message in completely new directory

When running the git init command in a completely new and empty directory, I get this error message: Reinitialized existing Git repository in //gittests/completelyEmptyDirectory/.git/ What is going on here? The only commands being…
Duskendale
  • 142
  • 4
  • 13
2
votes
1 answer

Folder structure for backend and frontend

Im setting up a project with a express node.js backend and react frontend. This is my first time setting a project up with a backend and their are a few things im unsure of... First question: So my current folder structure is this: --backend    …
1
vote
1 answer

How to init git on a running production server and update from a remote repo

I just got onboard with a project that has a live server that has been running for a year without git. In the past, the owner/dev made all code updates personally without version tracking. Then he started using git (with a gitlab account) for…
Hoytman
  • 1,722
  • 2
  • 17
  • 29
1
2 3 4