How do I add Git version control (Bitbucket) to an existing source code folder?

前端 未结 5 639
天命终不由人
天命终不由人 2020-12-22 15:42

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 i

5条回答
  •  不思量自难忘°
    2020-12-22 16:15

    Final working solution using @Arrigo response and @Samitha Chathuranga comment, I'll put all together to build a full response for this question:

    1. Suppose you have your project folder on PC;
    2. Create a new repository on bitbucket:

    3. Press on I have an existing project:

    4. Open Git CMD console and type command 1 from second picture(go to your project folder on your PC)

    5. Type command git init

    6. Type command git add --all

    7. Type command 2 from second picture (git remote add origin YOUR_LINK_TO_REPO)

    8. Type command git commit -m "my first commit"

    9. 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
    

提交回复
热议问题