{"id":25606960,"url":"https://github.com/panntod/push-existing-project-to-github","last_synced_at":"2026-05-17T03:04:57.696Z","repository":{"id":231280631,"uuid":"781347290","full_name":"panntod/Push-Existing-Project-to-GitHub","owner":"panntod","description":"Already have a file on local, but confused about how to upload it to digithub using git? follow this simple way","archived":false,"fork":false,"pushed_at":"2024-04-03T08:32:26.000Z","size":364,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-08T00:17:49.269Z","etag":null,"topics":["git","github"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/panntod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-03T07:59:18.000Z","updated_at":"2024-04-30T07:42:20.000Z","dependencies_parsed_at":"2024-04-03T09:45:18.317Z","dependency_job_id":null,"html_url":"https://github.com/panntod/Push-Existing-Project-to-GitHub","commit_stats":null,"previous_names":["panntod/push-existing-project-to-github"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panntod%2FPush-Existing-Project-to-GitHub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panntod%2FPush-Existing-Project-to-GitHub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panntod%2FPush-Existing-Project-to-GitHub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panntod%2FPush-Existing-Project-to-GitHub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panntod","download_url":"https://codeload.github.com/panntod/Push-Existing-Project-to-GitHub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240072127,"owners_count":19743526,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github"],"created_at":"2025-02-21T19:17:51.837Z","updated_at":"2026-04-30T14:30:20.415Z","avatar_url":"https://github.com/panntod.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to Push an Existing Project to GitHub\nGitHub is a cloud-hosted Git management tool. Git is distributed version control, meaning the entire repository and history lives wherever you put it. People tend to use GitHub in their business or development workflow as a managed hosting solution for backups of their repositories. GitHub takes this even further by letting you connect with coworkers, friends, organizations, and more.\nIn this tutorial, you will learn how to take an existing project you are working on and push it so it also exists on GitHub.\n\n## Step 1 \n### Create a new GitHub Repo\nSign in to GitHub and [create a new empty repo](https://github.com/new). You can choose to either initialize a README or not. It doesn’t really matter because we’re just going to override everything in this remote repository anyway.\n\n## Step 2\n### Initialize the Git Repo\nMake sure you are in the root directory of the project you want to push to GitHub and run:\n```bash\ngit init\n```\nThis step creates a hidden .git directory in your project folder, which the git software recognizes and uses to store all the metadata and version history for the project.\n\n### Add the files to the Git index\n```bash\ngit add -A\n```\nThe git add command is used to tell git which files to include in a commit, and the -A (or --all) argument means “include all”.\n\n### Commit Added Files\n```bash\ngit commit -m 'Added my project'\n```\nThe git commit command creates a new commit with all the files that have been \"added\". The -m (or --message) flag sets a message to be included with the commit, which is used as a future reference to understand the commit. learn [semantic commit](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716) for easier teamwork\n\n### Add a new remote origin\n```bash\ngit remote add origin \u003cYour Repository Github Url\u003e\n```\nIn git, a “remote” refers to a remote version of the same repository, which is typically on a server somewhere (in this case, GitHub). “origin” is the default name git gives to a remote server (you can have multiple remotes), so git remote add origin instructs git to add the URL of the default remote server for this repo.\n\n### Push to GitHub\n```bash\ngit push -u -f origin main\n```\nThe -u (or --set-upstream) flag sets the remote origin as the upstream reference. This allows you to later perform git push and git pull commands without having to specify an origin since we always want GitHub in this case.\nThe -f (or --force) flag stands for force. This will automatically overwrite everything in the remote directory. We’re using it here to overwrite the default README that GitHub automatically initialized.\n\n*Note: If you did not include the default README when creating the project on GitHub, the -f flag isn’t really necessary.\n\n## Or you can use this quick way\n\nby following these steps you can directly upload it to github\n\n![create a new github repo](https://github.com/panntod/Push-Existing-Project-to-GitHub/blob/main/images/create-new-repository.png)\n\n![select name](https://github.com/panntod/Push-Existing-Project-to-GitHub/blob/main/images/select-name.png)\n\n![copy code](https://github.com/panntod/Push-Existing-Project-to-GitHub/blob/main/images/copy-code.png)\n\n![paste code](https://github.com/panntod/Push-Existing-Project-to-GitHub/blob/main/images/paste-code.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanntod%2Fpush-existing-project-to-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanntod%2Fpush-existing-project-to-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanntod%2Fpush-existing-project-to-github/lists"}