Heroku remote won't delete - heroku

I need to remove an existing Heroku remote. I've done this before, but it just doesn't seem to be working this time around. I've searched for options, and tried solutions from other posts, but I feel like I'm going in circles. Here's what I have:
$ git remote -v
heroku git#heroku.com:radiant-journey-2028.git (fetch)
heroku git#heroku.com:radiant-journey-2028.git (push)
I've tried:
$ git rm -rf heroku
$ git rm -rf heroku remote
$ rm heroku remote
However, all I get is (or variations of these responses):
fatal: pathspec 'heroku' did not match any files
rm: heroku: No such file or directory
rm: remote: No such file or directory
What am I missing?

Removing a remote in git is achieved with the following command:
git remote rm heroku

git remote rm heroku
This is the correct format

Related

How to deal: not a git repository: '/home/user/git' even if it is

Some time ago i created a 'git' directory in a home path, just to store repos i use. But this somehow broke all my git system and even in ~ folder, when i was trying to use git, i was outputting me this (PWD=/home/user):
$ git status
fatal: This operation must be run in a work tree
I've removed 'git' folder, but appear another problem (PWD=/home/user):
$ git status
fatal: not a git repository: '/home/user/git'
I tried to reinstall git. Not helped. I'm a bit confused about this.
UPD #1:
I'm sorry for bad explanation at the beginning.
This should be clear enough:
$pwd
/home/user/MyGitRepos/some_repo/
$ls -a
. .. .git README.md
$git status
fatal: not a git repository: '/home/user/git'
Any path i am /, /etc, /home/user/ gives me the same output:
fatal: not a git repository: '/home/user/git'
Double-check your environment variables.
If you have GIT_DIR or GIT_WORK_TREE set to /home/user/git, that would explain the error message.
Check also git config -l --show-scope --show-origin in case any configuration would also reference that path.

How to clear the (Master) sign from git bash?

I have a Windows PC with git installed. Whenever I start git bash, it always stands at /c/Users/_user with the master branch as below: user#DESKTOP-VE8378L MINGW64 ~ (master)
I guess it should look like user#DESKTOP-VE8378L MINGW64 ~
I had a look at people around, found out that they don't have (master) at their first start using git bash. I checked git repo at where I stand with git remote -v but there is nothing.
I tried git status but there is also nothing to help.
maybe you created a git repository in your home directory?
Do you have a .git directory in your home?
If that's the case you should move that repository in a different directory, or delete the .git direcotory if it was created by mistake.

Why does my git bash always start at master branch?

I have a Windows PC with git installed. Whenever I start git bash, it always stand at /c/Users/_user with master branch as below:
NativeKiwi#nkiwi MINGW64 ~ (master)
I think it should look like this:
NativeKiwi#nkiwi MINGW64 ~
I had a look at people around, found out that they don't have (master) at their first start using git bash. I checked git repo at where I stand with git remote -v but there is nothing.
The string shown in your prompt depends on your PS1 environment variable.
Please check your .bash_profile or .bashrc for the configuration of PS1 environment variable.
I had the same issue (due to running git init) in the wrong directory and fixed it by running rm -rf .git in that directory.
You are seeing master because you created a git repository at the current path using the git init command. Always create git repositories in the folders containing project files. Consider running rm -rf .git command.

System level git config in mac

I am able to see global and local config files at usual locations.
But if i type
git config --system --list
it gives me
fatal: unable to read config file '/Library/Developer/CommandLineTools/usr/etc/gitconfig': No such file or directory
Any idea why it is looking there?
And why it is not set? Where is
system git config location for Mac?
There is no file at /etc/gitconfig or $HOME/.config/git (prescribed location got *nix and osx respectively)
EDIT
doing
sudo git config --system --list
does not help
#Abhijit Mazumder:
I know this is an old question, but I had a similar issue when attempting to set a system level git config value on my mac and thought I would post my solution here in case it could help you.
NOTE: I strongly suspect that if you simply create the
'/Library/Developer/CommandLineTools/usr/etc/' directory and create a
file called gitconfig within that directory, then your attempts at
viewing or setting system level git config values will be successful.
My first attempt at setting a system level git config value on my mac was:
git config --system alias.cl clone
This resulted in an error:
error: could not lock config file /Applications/Xcode.app/Contents/Developer/usr/etc/gitconfig: No such file or directory
I thought perhaps I needed to add 'sudo' to the command:
sudo git config --system alias.cl clone
But running the command with 'sudo' gave me the same error:
error: could not lock config file /Applications/Xcode.app/Contents/Developer/usr/etc/gitconfig: No such file or directory
So, from the root directory on my mac, I switched into the 'usr' directory mentioned in the error, just to see what was in there:
cd Applications/Xcode.app/Contents/Developer/usr/
I was surprised to find that there was no 'etc' directory. The only directories I saw were 'bin', 'lib', 'libexec', and 'share'.
So I decided to create what was missing. I first created an 'etc' directory:
sudo mkdir etc
And then created a gitconfig file in the 'etc' directory:
sudo touch etc/gitconfig
I was then able to set a system level git config value with the following command:
sudo git config --system alias.cl clone
In order to confirm that the system level git config value had actually been set, I viewed the contents of the gitconfig file.
I first used the unix 'cat' command while inside my 'usr' directory:
cat etc/gitconfig
The output from the 'cat' command was:
[alias]
cl = clone
Then I used a git command (the same one you were trying to use in your question) to check that my system level git config value had been set:
git config --system --list
The output from this command was:
alias.cl=clone
The last thing I needed to do to ensure that I had placed my file in the proper location was try the alias I had created, so I tried running:
git cl
Running this command using the alias I created resulted in the following output, which confirmed for me that everything was working properly:
You must specify a repository to clone.
usage: git clone [<options>] [--] <repo> [<dir>]
-v, --verbose be more verbose
-q, --quiet be more quiet
--progress force progress reporting
-n, --no-checkout don't create a checkout
--bare create a bare repository
--mirror create a mirror repository (implies bare)
-l, --local to clone from a local repository
--no-hardlinks don't use local hardlinks, always copy
-s, --shared setup as shared repository
--recursive initialize submodules in the clone
--recurse-submodules initialize submodules in the clone
--template <template-directory>
directory from which templates will be used
--reference <repo> reference repository
--dissociate use --reference only while cloning
-o, --origin <name> use <name> instead of 'origin' to track upstream
-b, --branch <branch>
checkout <branch> instead of the remote's HEAD
-u, --upload-pack <path>
path to git-upload-pack on the remote
--depth <depth> create a shallow clone of that depth
--single-branch clone only one branch, HEAD or --branch
--separate-git-dir <gitdir>
separate git dir from working tree
-c, --config <key=value>
set config inside the new repository
I have not come across this error as my machines are only used by me so setting --global level is enough, however that location looks reasonable (I assume you are using the git supplied with the Xcode command line tools).
Using sudo to configure what you want should work:
$ sudo git config --system <name> <value>

Setup a git bare repo on a windows apache server

I need help in setting up a bare git repo on an apache web server. I followed the below instructions
$ cd /var/www/htdocs/
$ git clone --bare /path/to/git_project gitproject.git
$ cd gitproject.git
$ mv hooks/post-update.sample hooks/post-update
$ chmod a+x hooks/post-update
I got these instructions from here
http://git-scm.com/book/en/Git-on-the-Server-The-Protocols.
I try to run
git clone "http://ip-addr/gitproject.git"
, but am not successful and neither the push command works. Do you have any suggestions on what to do next.
At least try it without the double-quotes:
git clone http://ip-addr/gitproject.git
And if it still hangs, check the log of your Apache server, to see if it is contacted at all.

Resources