Fork me on GitHub

Git项目的初始化

快速设置— 如果你知道该怎么操作,直接使用下面的地址

git@github.com:username/myproject.git

我们强烈建议所有的git仓库都有一个READMELICENSE.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

  

posted @ 2018-08-21 00:19  stardsd  阅读(636)  评论(0编辑  收藏  举报