I know there's an option to make a local repository for your project when you first create it, but is there an option create a repository after you've created your project?
A new repo should only be created for a new project. For instance, if you are working on a 2 different e-commerce sites, don't put them in the same repo unless they have to work together.
git init Existing Folder For an existing project to become a Git repository, navigate into the targeted root directory. Then, run git init . Or, you can create a new repository in a directory in your current path. Use git init <directory> and specify which directory to turn into a Git repository.
The steps to follow in order to push new Git branches to remote repos such as GitHub, GitLab or Bitbucket are as follows: Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch.
Sure, just run the following command in your project directory:
git init
This will create the .git
directory containing an empty repository. Then, add and commit your files.
In the command prompt, make sure you're in the desired directory and perform a git init
and you will have created an empty repository.
You can then proceed to add the files and directories to the repository by doing
git add <filename1> <filename2> ...
or you can select whole directories and use *
to act as a wild card of sorts.
git add ./*
If you have any more questions check out these pages:
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With