博客
关于我
github服务器与电脑端互联
阅读量:481 次
发布时间:2019-03-06

本文共 873 字,大约阅读时间需要 2 分钟。

两种方式,

一、从远程库克隆

1、现在github上 create respoisity,

仓库名字就叫MyAndroidProject,(github上面的仓库是可以删除的,又上角setting键拉到最后就是)。

建好仓库,shell命令行进入Android项目目录,把github上同名仓库拉下来,

git clone https://github.com/githubusername/MyAndroidProject.git

或者

$git clone git @github.com:githubusername/MyAndroidProject.git

然后Android目录下会看到一个跟GitHub仓库同名的目录,里面的文件拷贝到上一级目录,然后删掉同名目录,然后输入命令将文件添加进版本控制

git add .

git commit -m "my first commit"

这样就把修改提交到了本地仓库

然后push到github上

git push origin master

二、添加到远程库 如果已经有了本地库,又想在github创建一个git仓库,并且让这两个仓库进行远程同步,这样github既可以作为备份,又和其他人协作

1、在github上创建一个同名仓库

2、在本地仓库下运行命令

$ git remote add origin git@github.com:githubusername/MrAndroidProject.git    关联远程库

 

3、本地库所有内容推送到远程库

$ git push -u origin master 

由于远程库是空的,我们第一次推送master分支时,加上了-u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。

以后,本子做了提交,可以通过命令

$ git push origin master  把本地master分之的最新修改推送至GitHub,

转载地址:http://zitdz.baihongyu.com/

你可能感兴趣的文章
nmap使用实战(附nmap安装包)
查看>>
Nmap哪些想不到的姿势
查看>>
Nmap扫描教程之Nmap基础知识
查看>>
nmap指纹识别要点以及又快又准之方法
查看>>
Nmap渗透测试指南之指纹识别与探测、伺机而动
查看>>
Nmap端口扫描工具Windows安装和命令大全(非常详细)零基础入门到精通,收藏这篇就够了
查看>>
NMAP网络扫描工具的安装与使用
查看>>
NMF(非负矩阵分解)
查看>>
nmon_x86_64_centos7工具如何使用
查看>>
NN&DL4.1 Deep L-layer neural network简介
查看>>
NN&DL4.3 Getting your matrix dimensions right
查看>>
NN&DL4.7 Parameters vs Hyperparameters
查看>>
NN&DL4.8 What does this have to do with the brain?
查看>>
nnU-Net 终极指南
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
No 'Access-Control-Allow-Origin' header is present on the requested resource.
查看>>
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>