![git add remote repository to existing project git add remote repository to existing project](https://i.stack.imgur.com/t5IDV.png)
- Git add remote repository to existing project how to#
- Git add remote repository to existing project code#
This can be achieved by following the instructions provided by Github. 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 repository to existing project 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.
![git add remote repository to existing project git add remote repository to existing project](http://jlord.us/git-it/assets/imgs/remotes.png)
Adding A Local Project to an Empty Github Repository 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 repository to existing project 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.
![git add remote repository to existing project git add remote repository to existing project](https://i.stack.imgur.com/0uEtw.png)
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.