Alternatively, you can start a repository locally with git init
.
After doing this, I recommend that you do commits locally, even to avoid losing work if gives you a problem or you inadvertently run some command with occasional side effects in the data.
Ready, after doing your commits, let's add the remote GitHub repository. You can follow the own GitHub tutorial , or decorate some commands (explanation below the command: / p>
git remote add origin [email protected]:user/projeto-muito-legal-show.git
# \___/ \____________________________________________/
# | endereço remoto do projeto no github
# apelido do repositório remoto
git fetch origin
Okay, now you have a remote configured correctly. After that, we can mix your branch with the branch remote (if something already has been created). Or, if the repository is still empty, just push.
To mix, you usually use% ( documentation ) to mix with the branch git merge origin/master
of the GitHub repository. But you can also try rewriting the history by putting all commits that you made as commits children of the remote branch , using master
(documentation ).
git merge origin/master # para fazer o merge
git rebase origin/master # para fazer o rebase
In the third case, you still have nothing on the remote. So you just need to give%% ( see more on this question , see documentation ).