1

A word is missspelled and I noticed when I tried to push something to my GitHub. Im trying to make a markdown file and push it to my GitHub but I keep getting errors. The username is right and so is the email. I entered git pull remote master and then I saw the misspelling in the error. How do I fix it or delete it and enter a new one?

vigos
  • 118
  • 1
  • 4
mariaah
  • 13
  • 6
  • It's not clear to me precisely which name(s) you are talking about, as there are many in Git. However, anything that is in your Git *configuration*, you can edit in whichever editor you have configured Git to use: just run `git config --edit`. (Note that you must configure Git to use your preferred editor so that you can thus tell Git to use your preferred editor to edit your configuration! :-) ) – torek Jul 04 '17 at 19:14
  • I got into edit mode and was able to fix the error but now it won't get out of it. Im using terminal btw – mariaah Jul 04 '17 at 19:21
  • I excited out and I'm going back in to check to see if the changes stuck. All I'm trying to do is push a new md file into my git hub and trying to learn the steps to do it from terminal. after getting back in and I tried a pull of my current repo it showed me it still misspelled. – mariaah Jul 04 '17 at 19:28
  • If you are looking at names stored *in commits*, the issue here is that commits are permanent and unchangeable. What's in the past, is that way forever. You can make new and improved replacement commits and stop using the old ones in favor of the new ones instead, but that's only sometimes worthwhile: the problem is that once a commit is pushed, you are no longer the only one using the commit, so now you must get *everyone* to stop using the old and terrible commits in favor of the new and improved ones. – torek Jul 04 '17 at 19:31
  • I want to change my remote origin. GitHub is spelled wrong – mariaah Jul 04 '17 at 19:32
  • I don't think anyone is using them. Im new to this. my experience in data science was spss and other statistical stuff but I have to learn to use this way for work and personal projects and I can't even push a file at the moment but I can code a red block in Minecraft with python. So I have something going for me I guess. – mariaah Jul 04 '17 at 19:33
  • In that case, if you want to replace commits via `git push`, you can use the `--force` flag, which tells the other Git (on GitHub, in this case) that you really do mean to "forget" some existing commits. But if it's just a URL typo, that's probably not in the commits. You can use VonC's answer to fix it rather than editing the config file in your editor; I just find it easier to fix small typos in the editor this way. – torek Jul 04 '17 at 19:40
  • fatal: unable to access 'https://gitbub.com/Mariaah81/Datascience.git/': Failed to connect to gitbub.com port 443: Operation timed out Maria-Amelia-Hernandezs-MacBook-Pro:datasciencecoursera Maria$ this is the error I get. GitHub is misspelled. – mariaah Jul 04 '17 at 19:41
  • Ah, I see, you want to replace `gitbub` with `github`. There should be a line in the config file under `[remote "origin"]` reading `url = ...` that has the typo. Correct the typo, write the file, and exit the editor and all should be well. – torek Jul 04 '17 at 19:43
  • I get into the edit part and I do something to make it editable in my terminal window but for some reason I can't seem write the file to save it. Sorry if Im dense but Ill get it eventually. – mariaah Jul 04 '17 at 19:45
  • A comment added to this question solved it but I will figure out how to use the edit option. Thank you! – mariaah Jul 04 '17 at 19:47

2 Answers2

0

I don't think you can erase it, but you can either make a new correct commit then push (preferred) or branch out a new commit (complicate the history, less preferred).

Ryan L
  • 119
  • 13
0

I want to change my remote origin. GitHub is spelled wrong

Simply type the right origin url with:

git remote set-url origin https://github.com/<yourName>/<yourRepo>.git

That avoid having to edit manually the .git/config (local config of the Git repo)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250