[使用]Git--命令行
2015-05-19 01:30
148 查看
如何利用终端命令将文件上传到github远程服务器
(1) git status 命令查看下状态。 (2) git pull 更新代码,确保代码是库上最新代码,防止覆盖其他人的提交。 (3) git add xxx/xxx 把修改后的文件加入到缓冲区。 (4) git commit 提交入库到本地服务器中,这一步会加入注释。 (5) git log 命令查看已提交的修改,是否正确。 (6) git push 命令把本地服务器上的内容更新到远程服务器上。
Test
1、## |--> SpongeBob:Extended Belief$ git status
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: Log/NSArray+Log.h new file: Log/NSArray+Log.m
更新代码
2、## |--> SpongeBob:Extended Belief$ git pull
Already up-to-date. SpongeBob:Extended Belief$ git add arch/arm/mach-msm/Log/NSArray+Log.h fatal: pathspec 'arch/arm/mach-msm/Log/NSArray+Log.h' did not match any files
将文件添加到缓冲区
3、## |--> SpongeBob:Extended Belief$ git add Log/NSArray+Log.h Log/NSArray+Log.m
提交到本地服务器
4、## |--> SpongeBob:Extended Belief$ git commit
[master 32d9e8c] 1.0 增加Log类扩展--中文,显示json解析后的数据。
2 files changed, 44 insertions(+)
create mode 100644 Log/NSArray+Log.h
create mode 100644 Log/NSArray+Log.m
5、## |--> SpongeBob:Extended Belief$ git log
commit 32d9e8c8219808493b708365b5d584464e9d4456
Author: SpongeBob_Han <1605319671@qq.com>
Date: Tue May 19 01:04:56 2015 +08001.0 增加Log类扩展--中文,显示json解析后的数据。commit b70ed276b4bc1ec67d443dc47c0c48ffbabae7ec
Author: Bing Ma <1605319671@qq.com>
Date: Tue May 19 00:45:19 2015 +0800Initial commit
提交到远程服务器
6、## |--> SpongeBob:Extended Belief$ git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:git config --global push.default matchingTo squelch this message and adopt the new behavior now, use:git config --global push.default simpleWhen push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 839 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To https://github.com/SpongeBob-GitHub/Extended.git b70ed27..32d9e8c master -> master
SpongeBob:Extended Belief$GitHub下载:https://github.com/SpongeBob-GitHub/Extended
相关文章推荐
- 命令行下Git的使用
- svn与git区别简介,git分支操作在mac客户端soureTree和使用命令行如何实现
- git命令行使用学习
- Android Studio 与 Github 的使用 (创建一个 Android 工程 with Git 命令行)
- git命令行使用帮助
- windows下使用TortoiseGit代替Git命令行操作
- GitHub 在使用命令行 git push 时报错:The requested URL returned error: 403
- git 命令行 使用指南
- 使用GIT命令行提交代码到GitHub
- 使用git bash here 命令行同步代码
- 使用Git命令行上传本地项目到GitHub
- 在AS中的Termianl中使用git命令行管理git,提示不是‘git’不是内部或外部命令的解决办法
- 使用git命令行进行项目合并
- 使用git命令行上传代码到github中
- 使用命令行将本地项目上传到git
- eclipse使用git命令行
- GitHub版本控制使用(命令行实际操作图解Git使用方法)
- 使用命令行如何让.git文件夹显示
- OS(关于版本控制)使用git 创建远程仓库-熟知这些命令行,带你装逼带你飞!
- git初次使用命令行总结