git

1. 强制上传 

git push -u origin master -f 

2. 本地创建分支并关联远程分支

- 在本地创建一个分支文件夹,并关联远程分支

git init
git remote add origin git@github.com:xiaoyisha/learngit.git

-  $ git pull <远程主机名> <远程分支名>:<本地分支名> 
如拉取远程的master分支到本地wy分支: 

git pull origin master:wy

3. git pull 合并

error: Your local changes to the following files would be overwritten by merge:
        src/main/java/chocopy/pa2/DeclarationAnalyzer.java
Please commit your changes or stash them before you merge.

git status
git add
git commit
git pull

4. 与fork的仓库同步

https://help.github.com/articles/configuring-a-remote-for-a-fork/

https://help.github.com/articles/syncing-a-fork/

5. 查看并reset本地commit

git config --global alias.tree "log --oneline --decorate --all --graph"
git tree
git reset --hard 42c1911

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值