2

I am a new user to command line. I have downloaded the repo, I do git init every time but still I get this error :

fatal : Not a git repostitory.. .git

EDIT : It also says my repo is empty but I am sure that I did clone and init it!!

These are the commands I am trying -

git submodule add -f -b REL1_25 https://github.com/wikimedia/mediawiki-extensions-CharInsert CharInsert

cd ../ && git add .gitmodules extensions/CharInsert

git commit -m 'Add CharInsert' && git push

3 Answers3

0

Well you need to be in your project to use git init. Make sure you have git in your station also use the git terminal for executing git commands.

If you want a fun way to learn git command line check This

If you need a straight to the point tutorial on each command try This

Hope this will help you to setup your repo properly.

Deus Levin
  • 193
  • 2
  • 13
  • What do you mean Git Terminal? So not Git Bash? And what do you mean git in your station? – Reception123 Aug 18 '15 at 05:10
  • Are you using linux or windows? Git in your station means you installed the git bin so that you can use the git command. Git terminal is the Git Shell if you are using windows. – Deus Levin Aug 18 '15 at 05:18
  • I know I have Git Bash. Now the problem is it says Initialised empty repostitory. But I did do git clone. Actually it did say something fatal after I did git clone.. Could that be it? – Reception123 Aug 18 '15 at 05:20
  • Lets clear things up. You use git clone if you are going to get a copy from an EXISTING git repo. If you are goint to create your OWN repo FROM SCRATCH you don't use git clone. https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone – Deus Levin Aug 18 '15 at 05:27
  • You dont need to use git init on a working repo if you cloned it. Make sure you are in the working repo directory. For Example: git clone AFTER THAT USE cd – Deus Levin Aug 18 '15 at 05:31
  • fatal : Not a git repostitory.. .git <- if you are getting this that means you are not inside the working repository – Deus Levin Aug 18 '15 at 05:33
  • If you are using windows your path should look like this. Whre Test is your working repo. C:\wamp\www\Test> <- use the cd command to navigate into your directory – Deus Levin Aug 18 '15 at 05:38
  • So could you please tell me the order? 1. I cloned the repo (it takes a while..) 2. ? How do I tell Git what repo I want? – Reception123 Aug 18 '15 at 05:39
  • Post your git clone command in here so I will know your position. Also include the path where you execute the command. Copy paste the whole line – Deus Levin Aug 18 '15 at 05:48
  • git clone http://github.com/Reception123/mediawiki And I am trying to install the commands that are already featured in the post.. and I keep getting not a git repo because I don't know how to select which repo I need. – Reception123 Aug 18 '15 at 05:51
  • After you use git clone try doing this command. cd mediawiki then type git status if it is working – Deus Levin Aug 18 '15 at 06:06
0

The full sequence should be (including directly the existing submodules):

cd C:\test
git clone --recursive http://github.com/Reception123/mediawiki
cd mediawiki
git submodule add -f -b REL1_25 https://github.com/wikimedia/mediawiki-extensions-CharInsert extensions/CharInsert
git add .
git commit -m "Add CharInsert extension"
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Reception123 do you mean the all extensions folder is empty, or extensions/Charset is not there? – VonC Aug 18 '15 at 07:15
0

if you want to generate a new git repository:

create a new git repository on the github.com, and input your Repository name and create the repository, you will see:

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin gitAddress
git push -u origin master

BUT, if you downloaded a git repo by using git clone gitAddress, PLEASE DO NOT USE 'git init' again cause it's already a git repo.

after download a git repo by using git clone, you should input 'cd foldername' to go to the exactly repo's folder, and you will never get the error again.

Harper Koo
  • 597
  • 5
  • 14