1. 程式人生 > >Git項目的初始化

Git項目的初始化

long ted reason xcod cti led target 操作 tor

快速設置— 如果你知道該怎麽操作,直接使用下面的地址

[email protected]: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 "[email protected]"

  

創建 git 倉庫:

mkdir nowcoder
cd nowcoder
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:stardsd_admin/nowcoder.git
git push -u origin master

  

已有項目?

cd existing_git_repo
git remote add origin [email protected]: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

  

Git項目的初始化