git入门
来源:互联网 发布:淘宝客服是怎么做的 编辑:程序博客网 时间:2024/06/06 14:03
创建版本库
mkdir -p /demo/helloworld-git
cd /demo/helloworld-git
git init
ls -al
将文件提交到本地版本库
cd /demo/helloworld-git
echo "hello world" > helloworld.txt
git add helloworld.txt
git commit -m ‘helloworld-master’
git log
rm helloworld.tx
git checkout helloworld.txt
创建本地分支
git branch
git branch new-branch
git branch -D new-branch
切换本地分支
git branch new-branch
echo “世界你好” > helloworld.txt
git commit -m helloworld-new-branch
git checkout master cat helloworld.txt //显示helloworld
git checkout new-branch cat helloworld.txt //显示 世界你好
在GitHub上创建开源项目
前面介绍的都是操作本地版本库和本地分支,git管理源代码都会使用远程的Git托管服务器(eg:GitHub)
git config --global user.name xuwuhao
git config --global user.email 1060xxxxx7@qq.com
然后输入用户名和密码
git remote add origin https://github.com/xuwuhao/xuwuhao.git
git push -u origin master //master是远程版本库origin中的主分支
git branch -a //查看所有本地和远程分支
git clone https://github.com/xuwuhao/xuwuhao.git //使用如下命令可以下载整个工程
git pull origin master //获得某一分支的最新内容
- GIT 入门
- Git入门
- git入门
- Git 入门
- git 入门
- git 入门
- git入门
- git入门
- Git 入门
- Git 入门
- Git入门
- git入门
- git入门
- git 入门
- git 入门
- Git入门
- Git入门
- git入门
- cvFitLine直线拟合函数的应用
- Android百分比布局使用小坑一个
- JS----拖拽图层,面向过程,面向对象
- Snail—iOS开发学习博客及网站
- 百度地图的封装
- git入门
- Running Maven Defaults and Overriding with TestNG
- C++实现Windows下的Daemon,监控多个进程
- 装修的注意事项
- TraceView工具的使用说明
- c++ 中 `++i` 与 `i++` 在运算表达式中的优先级
- codecombat安息之云山峰11-21关及沙漠38关代码分享
- 【转】c++中vector的用法
- echarts简单实例+ $.extend()方法解析