How can I add the contents of an existing folder to Git version control?
The tutorial here covers the case of making a directory and then adding source contents to it. I have some source code in a folder that is path dependent and don't want to move it.
So, how can I just go into my folder and make it a repository?
Adding a remote repository To add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at. The git remote add command takes two arguments: A remote name, for example, origin.
Final working solution using @Arrigo response and @Samitha Chathuranga comment, I'll put all together to build a full response for this question:
Create a new repository on bitbucket:
Press on I have an existing project:
Open Git CMD console and type command 1 from second picture(go to your project folder on your PC)
Type command git init
Type command git add --all
Type command 2 from second picture (git remote add origin YOUR_LINK_TO_REPO
)
Type command git commit -m "my first commit"
Type command git push -u origin master
Note: if you get error unable to detect email or name, just type following commands after 5th step:
git config --global user.email "yourEmail" #your email at Bitbucket git config --global user.name "yourName" #your name at Bitbucket
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