skip to Main Content

I have a project that I am working on for quite a while. In PHP.
Now I would like to use GitHub for version control and allowing me to work on it from multiple pc’s.

My laptop or desktop.
Or in case of a crash, failure, flood or WWIII another pc.
Let’s hope the last case will never come true. Though I fear that GitHub won’t be available then either.

My working environment is Windows. And I installed GitHub Desktop 2.2.1.
Now I created a new repository and that on its turn created a new directory. Not entirely the directory I wanted. But ok.
(it should be K:/wamp64/www/myproject/system/, and GitHub decided it to be the name I gave it. K:/wamp64/www/myproject/system/my-project/)

Now I would like to add the files of the existing project to this repository. But there is no option to add existing files or either new files. Whenever I try dragging them in. GitHub reports that this is no valid GIT.

So I am probably, if not certain doing something wrong.
Now what is the step I am missing. All tutorials online show a couple of Lunix shell commands. Using Windows this is pretty useless for me.
Hopefully there’s one that could give me a firm kick in the right direction.

2

Answers


  1. You can turn your existing directing into a git repo by doing git init . That will create the .git directory. Then you can push the files to GitHub.

    Login or Signup to reply.
  2. Try install Git CLI or Git GUI for windows using following link: https://git-scm.com/download/win
    NExt follow the commands provided in the new git repository to add the existance files to the project.
    steps after cloning the remote repo to your local repo will be as follows:

    • git add .
    • git commit -m “add comments here”
    • git push origin master

    try following two links to understand git more:
    https://rogerdudler.github.io/git-guide/
    https://www.tutorialspoint.com/git/index.htm

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search