![Git项目的初始化 Git项目的初始化](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
快速设置— 如果你知道该怎么操作,直接使用下面的地址
git@github.com:username/myproject.git
我们强烈建议所有的git仓库都有一个README
, LICENSE
, .gitignore
文件
Git入门?查看 帮助 , Visual Studio / TortoiseGit / Eclipse / Xcode 下如何连接本站, 如何导入项目
简易的命令行入门教程:
Git 全局设置:
git config --global user.name "Star_dsd"
git config --global user.email "stardsd@qq.com"
创建 git 仓库:
mkdir nowcoder
cd nowcoder
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin git@gitee.com:stardsd_admin/nowcoder.git
git push -u origin master
已有项目?
cd existing_git_repo
git remote add origin git@gitee.com:stardsd_admin/nowcoder.git
git push -u origin master
error
error: src refspec master does not match any.
error: failed to push some refs to 'ssh://xxxxx.com/project.git'
# The most probable reason for this error is that all the files are untracked and have not been added.
git add --all
#in case you wish to add all the files
#Or you can selectively add files. Then
git commit -m "Initial comment"
git push origin master