Skip to content

Instantly share code, notes, and snippets.

Last active October 1, 2021 10:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
based on tutorial in
and this tutorial to upload existing project into github.
so, you need to create new repository first
- make sure you have installed git in your computer
- open the directory project then open CMD in it
- type 'git init'. This will say "Initialized empty git repository in ....git" (... is the path).
- type 'git add .' Dont forget 'pull stop' mark in the end of add after 'space'. I assume you wanna upload a whole file inside the directory.
- type 'git commit -m "massage here for commit"
- type 'git remote add name_of_local_branch[e.g origin]
[SINCE 2021 due to latest policy from github (]
so I already set Token generated
-type 'git remote set-url name_of_local_branch[e.g origin]
- now you've been ready to push, but before that you need to 'git pull' to prevent error
- type 'git pull origin master'. As a new repo, this action should to be executed.
* because this case is firt time commit on fresh repo
* recommend to use this one, 'git pull origin master --allow-unrelated-histories' based on (
* when command 'git pull origin master' give you an error. Try command 'git pull --rebase origin master' based on (
* when it succeed, you're ready to push your existing project to github
- type 'git push -u origin master'
then upload progress will be processed. Let it finish!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment