Add project already exists to github

Asked

Viewed 2,087 times

0

I already have a solution created on github, I’ve already created an account too, I just want to add my project already done in a repository, but I’m not getting it. I’ve already added the github extension to visual studio.

1 answer

2


I always wear this website as a reference.

create a new folder, open it and run the command

git init

to create a new repository.

create a working copy in a local repository by running the command:

git clone /caminho/para/o/repositório

when using a remote server, your command will be

git clone usuário@servidor:/caminho/para/o/repositório

workflow your local repositories consist of three "trees" maintained by git. the first of them is your Working Directory that contains the current files. the second Index which functions as a temporary area and finally the HEAD which points to the latter commit (confirmation) you have made.

add & confirm You can propose changes (add them to the Index) using

git add <arquivo>
git add *

This is the first step in the basic git workflow. To actually confirm these changes (i.e., commit), use

git commit -m "comentários das alterações"

Now the file is uploaded to HEAD, but not yet to the remote repository.

sending changes Your changes are now in the HEAD of your local working copy. To upload these changes to your remote repository, run

git push origin master

Change master to any branch (branch) you want by sending your changes to it.

If you haven’t cloned an existing repository and want to connect your repository to a remote server, you should add it with

git remote add origin <servidor>

Now you are able to send your changes to the selected remote server.

  • Thank you very much helped me

  • @Cezarmdlosci nothing, so vote ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.