Migrate your existing website to git

I have a site written in php, jquery. I just started a repository for it on github and successfully copied the readme text file to the site.

How do I (a) integrate an entire site into a git repository? The project_git directory is currently at the same level as the httpdocs directory. How to put it inside, but make sure the site remains and is good?

(b) create a local repository that can click on this site?

Your help would be greatly appreciated.

+4
source share
3 answers

Skip the README file and copy it.

  • Create an empty repository in github
  • git init in the folder where you want to track all your files, for example. httpdocs
  • git add .
  • git commit -m 'first commit'
  • Add the repo on github as remote, for example. git remote add origin < githubpath >
  • Raise the main branch to github with git push origin master

Now you can add your README, commit and click or do it in step 3

+4
source

If you entered the README.txt file in github, you are all set up (with a local repository). git will not bind to your current directory structure, so it should be as simple as:

git add .

git commit -m "first commit of website"

git push origin master

And you should see everything on github

+2
source

You need to give us a little more information about the structure of your file directory and possibly which platform you will find useful.

Also note: if you just created a free github account, clicking on your site will make the publication public. Just to think.

But basically, all you need to do to host the site on github is: 1) Go to the root directory of the site 2) Follow the instructions on github to create an open git repo 3) Run git add., Git commit -m " commit, git click

And you have to do it! Especially if you have already pushed things to the site, you have already taken care of setting up the RSA key and things :)

+1
source

Source: https://habr.com/ru/post/1400302/


All Articles