![git add remote github git add remote github](https://john-kim.gitbooks.io/training-github/content/images/git-flow-left-2.png)
Github’s instructions work perfectly-for those creating a new project folder without existing version control. Option 1: Push a Newly-Created Project Folder Creating a new project and following Github’s instructions works out as expected. The first one works as expected but Github’s instructions for the second can cause issues. This requirement can be satisfied either by creating a new project (Option 1) or by pushing an existing project (Option 2). It should go without saying you need to have an existing project before attempting to add something to Github. Let’s see what our newly-minted Github repository looks like.
#GIT ADD REMOTE GITHUB HOW TO#
In this article, you’ll learn how to quickly initialize a local project folder for versioning via git, create an empty repo on Github, and then push your local project to that repo. Adding A Local Project to an Empty Github Repository
![git add remote github git add remote github](https://i.stack.imgur.com/YyT7y.png)
The main argument represents the new default branch name (updated from master in most cases.) This will avoid pushing a second master branch to new empty Github repos with an empty main default branch. To reconfigure one’s local GIT software’s default branch name use the following command: GIT may not reflect this change when creating local projects first. A previous version of this article described pushing things to master but has been updated to reflect the change. git initĢ022 Update: Github has changed the name of the default branch from master to main. Note: this will delete anything currently in the remote repo.
#GIT ADD REMOTE GITHUB CODE#
The following code will ensure your local project makes it to the remote repo every time. TL DR – Github’s instructions for adding a local project to an empty repo don’t always work out as expected. Unfortunately, the instructions offered by Github on an empty repo’s URL don’t always work out smoothly. This is a useful workflow for local projects in need of remote versioning. Adding a local project to an empty repository on Github is an easy process.