Directory management in git

0

I'm now starting to use the git service, more precisely GitHub, but I've had some doubts:

My projects in JavaScript are all in a directory on my Desktop, however all the git tutorials I read say to create and configure a local folder where the files will be committed, I created a folder in my documents, but every time I change the files in my projects folder, should I copy the files to the folder I created for git and through GitBash upload the files?

This is still a bit confusing for me, after all, should I now centralize all my codes in all languages in that single directory? How does this git folder work with INDEX, etc?

    
asked by anonymous 29.05.2018 / 14:00

2 answers

1

Friend is not quite as you are thinking, first you will create a repository in GitHub and then clone on your machine. After that you will copy all your files that were in another folder into the folder of your repository, done that you will no longer work in your old folder but inside the folder of the GitHub repository there any changes you make may be committees and uploaded to GitHub there.

I hope to have helped my friend.

    
29.05.2018 / 14:08
0

I would advise you to create a workbook for each project. After that, use the following command in the chosen folder. This command initializes a new local repository.

git init

Considering that you already have a local repository, run the following command within your workbook.

git remote add origin git://github.com/usuario/meurepositorio.git

The above command links a remote GitHub repository to your local (workbook).

After committing, you can upload the changes to your repository in GitHub using the command:

git push origin master
    
29.05.2018 / 14:39