Vee*_*eti 80
git init
git add .
git commit -m "Initial commit"
Run Code Online (Sandbox Code Playgroud)
在此之后,创建一个新的GitHub存储库并按照屏幕上的说明进行操作.
Rob*_*son 28
如果您尚未在Github中创建项目,请在该站点上执行此操作.如果内存服务,它们会显示一个页面,告诉您如何将现有代码放入新存储库.但是,冒着过于简单化的风险,你会遵循Veeti的指示,然后:
git remote add [name to use for remote] [private URI] # associate your local repository to the remote
git push [name of remote] master # push your repository to the remote
Run Code Online (Sandbox Code Playgroud)
mrm*_*oje 21
只是为了补充其他答案,在我了解git之前,我正在寻找一些方法将现有代码上传到新的github(或其他git)repo.这是为新手节省时间的简报: -
假设您准备好了新的空github或其他git repo: -
cd "/your/repo/dir"
git clone https://github.com/user_AKA_you/repoName # (creates /your/repo/dir/repoName)
cp "/all/your/existing/code/*" "/your/repo/dir/repoName/"
git add -A
git commit -m "initial commit"
git push origin master
Run Code Online (Sandbox Code Playgroud)
或者,如果您有一个现有的本地git仓库
cd "/your/repo/dir/repoName"
#add your remote github or other git repo
git remote set-url origin https://github.com/user_AKA_you/your_repoName
git commit -m "new origin commit"
git push origin master
Run Code Online (Sandbox Code Playgroud)
您可以使用其存储库API(http://develop.github.com/p/repo.html)通过命令行创建GitHub存储库
使用命令行检查创建github存储库 自己动手做Android用例.
归档时间: |
|
查看次数: |
133301 次 |
最近记录: |