git远程上传文件至github

首先在github 上创建一个仓库,也可以创建一个组,几个人一个组创建一个仓库,共同去完成 任务并且可以资源共享。

在创建完仓库之后,然后进入终端,下载git

首先把仓库克隆到git上,命令为

:git clone https://github.com/jjuc/developRos.git

在终端输入git 就可以看到很多指令   jjuc代表我自己创的组,developRos 表示我创的仓库。

成功如下

[email protected]51:~$ git clone https://github.com/jjuc/developRos.git
正克隆到 ‘developRos‘...
remote: Enumerating objects: 223, done.
remote: Counting objects: 100% (223/223), done.
remote: Compressing objects: 100% (173/173), done.
remote: Total 223 (delta 92), reused 160 (delta 41), pack-reused 0
接收对象中: 100% (223/223), 38.46 KiB | 307.00 KiB/s, 完成.
处理 delta 中: 100% (92/92), 完成.

然后在git的developRos目录下创建你的文件并敲写你的代码

然后执行下列操作

git add .
git commit

每次上传文件时,要保证库处于最新状态

可用 git pull  验证一下

最后上传文件

git push

成功如下

[email protected]51:~/developRos/tan_py$ vim lock.py
[email protected]-Nitro-AN515-51:~/developRos/tan_py$ git commit -m ‘first_commit‘
[master f8f7956] first_commit
 1 file changed, 23 insertions(+)
 create mode 100644 tan_py/lock.py
[email protected]-Nitro-AN515-51:~/developRos/tan_py$ git remote add origin https://github.com/findingsea/myRepoForBlog.git
fatal: 远程 origin 已经存在。
[email protected]-Nitro-AN515-51:~/developRos/tan_py$ git pull
已经是最新的。
[email protected]-Nitro-AN515-51:~/developRos/tan_py$ git push
Username for ‘https://github.com‘: tanshengjiang
Password for ‘https://[email protected]‘:
对象计数中: 4, 完成.
Delta compression using up to 4 threads.
压缩对象中: 100% (4/4), 完成.
写入对象中: 100% (4/4), 586 bytes | 586.00 KiB/s, 完成.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/jjuc/developRos.git
   61048ab..f8f7956  master -> master

原文地址:https://www.cnblogs.com/tanshengjiang/p/11751191.html

时间: 2024-08-01 08:48:03

git远程上传文件至github的相关文章

git远程上传文件

[第一步]建立先仓库 第一步的话看一般的提示就知道了,在github新建一个repository(谷歌可以解决),都是可视化的界面操作,所以难度不大.或者看这里:https://help.github.com/articles/create-a-repo 这是官方help,虽然是英文的,但是基本都是图和代码,所以很容易读懂. 在github首页的右上角,点击红框中的Create New Repo. 进入新建仓库的界面 填一下仓库名称,Initialize this repository with

利用 git 上传文件到 github

git 常用命令汇总 git config --global user.name "" git config -- global user.email "" git config --list  (查看配置详情) git status   (查看当前仓库状态) git add   (将工作区中的文件添加到暂存区) git commit -m"description"   (将暂存区的文件提交到本地仓库,-m 后添加的是对文件的注释或解释说明) g

【转载】关于初学者上传文件到github的方法

关于初学者上传文件到github的方法 分类: GitHub2013-08-30 00:49 11821人阅读 评论(3) 收藏 举报 说来也惭愧,我是最近开始用github,小白一个,昨天研究了一个下午.终于可以上传了,所以今天写点,一来分享是自己的一些经验,二来也是做个记录,万一哪天又不记得了:) 废话不多说,直接来,这次主要介绍的是windows下的安装和使用. [第一步]建立先仓库 第一步的话看一般的提示就知道了,在github新建一个repository(谷歌可以解决),都是可视化的界

MAC 上传文件到github

在IOS中,经常需要上传文件到github.以桌面上的一个文件夹为例: 步骤1: cd 到该文件夹下,建立POD文件. $ cd /Users/andy/Desktop/openinstallSDK ls OpenInstallSDK.h libOpenInstallSDK.a 建立podspec文件: pod spec create openinstallSDK 查看文件: vim openinstallSDK.podspec 复制命令,然后在终端输出: 然后在GitHub这个地址中,发现多了

SSH 连接树莓派、远程上传文件

一.操作环境: 树莓派Raspbian系统 默认用户名:pi 默认密码:raspberry 假定局域网IP为 192.168.1.100 二.SSH登录 $ ssh [email protected] $ 输入密码 raspberry 三.远程上传文件 $ scp <localfile> [email protected]:/home/pi/ $ 输入密码 raspberry 参考链接:http://blog.csdn.net/arnoldlu/article/details/17394237

git上传文件到github与gulp的简单使用

git有两种方式提交源代码到github 第一种方式通过地址提交下面介绍的是通过ssh方式上传 git使用ssh方式上传代码到githubgit首先要生成公钥和私钥 将公钥添加到github中将私钥保存在本地 + 命令:`ssh-keygen -t rsa`生成的公钥与私钥文件会在当用户目录的.ssh目录下. 把代码push到服务器时需要先pull一下(pull的作用是从远程下载git项目里的文件,然后将文件与本地的分支进行merge) git pull和gitclone区别:git pull

本地上传文件到github

我是一开始创建了用于远程访问项目仓库的ssh key 这篇文章不介绍搭建ssh key 1.先在github上创建仓库 首先登录自己的github,点击右上角的+号 , 然后 然后 然后 然后 出现这个 输入  git  init  结果如下 然后   git clone  +复制内容 然后 打开克隆到本地的文件夹,然后把要上传的文件放到里面 接着   ls  查看文件 接下来就开始上传文件了                    git  add .                    gi

linux远程登入、远程上传文件

一.远程登入 1.安装 Xshell5 2.查看是否具备连接 在linux 主机上输入 chkconfig --list | grep sshd #sshd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭 #5要保持开启状态 如果没有开启手动开启指令 chkconfig --level 5 sshd on service sshd restart 3.查询机子ip ifconfig 4.配置Xshell5 基本上配置上ip即可 二.远程上传下载文件 1.安装Xftp 2.配

Hadoop在HA模式下远程上传文件的实现

在非HA模式下,只须如下代码就可以轻松实现上传文件,标红的这句是关键 public class CopyToHDFS { public static void main(String[] args) throws IOException { Configuration conf = new Configuration(); conf.set("fs.defaultFS", "hdfs://master:9000"); FileSystem fs = FileSyst