{"id":20054768,"url":"https://github.com/abhi5658/local-folder-to-github","last_synced_at":"2026-05-01T23:32:30.115Z","repository":{"id":88356530,"uuid":"258498207","full_name":"abhi5658/local-folder-to-github","owner":"abhi5658","description":"Steps to put local folder as git repo on Github/Bitbucket or any git online tool without it being already synced online","archived":false,"fork":false,"pushed_at":"2020-07-14T18:47:43.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-30T11:55:53.647Z","etag":null,"topics":["bitbucket","computer","folder","git","github","go-online","local","local-folder","local-repository","local-storage","machine","make","offline","online","online-repository","personal","remote","repo","save","storage"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/abhi5658.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,"publiccode":null,"codemeta":null}},"created_at":"2020-04-24T11:51:14.000Z","updated_at":"2020-07-14T18:47:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"3252c600-53f5-483c-8b80-9500c4c4e402","html_url":"https://github.com/abhi5658/local-folder-to-github","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abhi5658/local-folder-to-github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi5658%2Flocal-folder-to-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi5658%2Flocal-folder-to-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi5658%2Flocal-folder-to-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi5658%2Flocal-folder-to-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhi5658","download_url":"https://codeload.github.com/abhi5658/local-folder-to-github/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhi5658%2Flocal-folder-to-github/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32517182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bitbucket","computer","folder","git","github","go-online","local","local-folder","local-repository","local-storage","machine","make","offline","online","online-repository","personal","remote","repo","save","storage"],"created_at":"2024-11-13T12:43:12.723Z","updated_at":"2026-05-01T23:32:30.081Z","avatar_url":"https://github.com/abhi5658.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README #\nThis file as well was created without creating a repo online on github\n\n## 1. Steps [ local ]:\n- Do not worry if you have multiple local commits already(Skip Step 1)\n- Create project directory folder\n- Create files/folders/anything inside it\n- Now this folder is still not a git repo(that tracks changes)\n- Open git bash to the parent directory(as per basics)\n- First thing initialise it with git command: `git init`\n- `.git` (may be hidden) folder is created which will now track the changes now in this directory\n- set user name and user email for this directory if it is different from the global user\n- Check credential using git command: `git config -l`\n    - If it shows user.name and user.email set to the credential you want then nothing to do.\n    - If not set name and email using using git command: \n        - `git config user.name \"Your name\"`\n        - `git config user.email \"emailid@thatcompany.com\"`\n    - Check again if the new credentials(if different) appears at end of list command: `git config -l`\n- Check status of tracked files command: `git status`\n- Add files to track. Easiest command: `git add --all`\n- Now time to commit this much\n- Commit command: `git commit -m \"first local commit\"`\n- Do more commits if needed\n\n## 2. Steps [ Github ] (or any git online tool):\n- Github does not have option to create a new repo from cli before installing some kind of other tool (as per last I know)\n- So first create a new repo on Github(I named it `local-folder-to-github` same as my local folder name)\n- Didn't selected the option to create a readme as I alreadt created one here\n- Time to connect this local folder to online repo\n- Copy repo url from github(in my case: `https://github.com/abhi5658/local-folder-to-github.git`)\n- Now got to cli and add remote to this local repo:\n    - Git command: `git remote add origin \u003crepo_url\u003e` (e.g. `git remote add origin https://github.com/abhi5658/local-folder-to-github.git`)\n        - This will let the local repository know that there is a reomte repo to which it has to push changes\n        - This statement sets `origin` alias to remote repo url\n    - There's another way to directly push the changes with the repo url directly:\n        - Git command: `git push --set-upstream origin master` to push the local changes to master branch on your online git repo. OR other way:\n        - Git command: `git push \u003crepo_url\u003e` (e.g. `git push https://github.com/abhi5658/local-folder-to-github.git`)\n        - This will be succesful if there's zero commits on the remote repo\n        - If any issue, related to error of unrelated history due to commits present on remote, follow next steps\n- Check if this is connected now, git command: `git remote -v`\n    - shows the fetch and push remote urls\n- You can try pushing the local commits but that would fail as first you need to pull remote commits\n- Time to pull the remote commits to local repo:\n    - Git command: `git pull origin master`\n    - produces error: 'fatal: refusing to merge unrelated histories'\n    - By pass this error by git command: `git pull origin master --allow-unrelated-histories`\n    - This would merge the local commits with the pulled commits(initial commit)\n- Push local commits to remote repo:\n    - Git command: `git push origin master`\n- Now the local commits and whole local folder(also a git repository) is pushed to online(remote) repository.\n\n### 3. Video depicting similar steps: https://youtu.be/fQLK8Ib_SKk?list=PL4cUxeGkcC9goXbgTDQ0n_4TBzOO0ocPR\u0026t=324\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhi5658%2Flocal-folder-to-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhi5658%2Flocal-folder-to-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhi5658%2Flocal-folder-to-github/lists"}