问题描述
如何将现有文件夹的内容添加到Git版本控制中?
教程
打开Git CMD控制台并从第二张图片输入命令1(转到您的项目折叠呃在你的电脑上)
输入命令 git init
键入命令 git add --all
第二张图片( git remote add origin YOUR_LINK_TO_REPO
)
输入命令 git push -u origin master $ c注意:如果您遇到错误无法检测到电子邮件或名称,只需在第5步之后输入以下命令即可:
$ b :
git config --global user.emailyourEmail#your email at Bitbucket
git config --global user.nameyourName#你在Bitbucket的名字
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?
Final working solutionusing @Arrigo response and @Samitha Chathuranga comment, I'll put all together to build a full response for this question:
- Suppose you have your project folder on PC;
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
这篇关于如何将Git版本控制(Bitbucket)添加到现有的源代码文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!