git克隆;上传;合并


1>克隆

git config --global user.name "hahaha"
git config --global user.email "hahaha@email.com"
1. 在本地创建文件夹D/test
2. git打开到本地文件夹下

cd d:

cd test

3.新建一个testgit版本库

mkdir testgit

cd testgit
4. git clone  http://hahaha@git.haha.cn (要用自己的)
5. 打开库:cd ha
6. 查看<远程>所有分支:git branch -r 
7. git checkout --track origin/×××(想要的分支名)

8.如果想取任一历史版本,操作如下:

打开库:cd ha

git clone(然后找到指定的版本)

git checkout fd009208(fd009208为commit的前8位),完成。


2>上传

git config --global user.name "abc"
git config --global user.email "abc@qq.com"
//1. git init
2. git add .     (查看状态git status)
3. git commit -m"我有一只小毛驴"    ------以上3步只是本地提交
4.git remote rm origin
   git remote add origin  http://hahaha@git.haha.cn
5.git push origin ××××(×为分支名)


3>合并

//把A合并到B
1.在B分支下,git merge A
2.手动解决冲突:git add 1.cpp
                               git add 2cpp
3.git commit -m"合并A"

4.git remote rm origin
   git remote add origin  http://hahaha@git.haha.cn
5.git push origin ××××(×为分支名)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值