Review some key points of Git

本文详细介绍了Git的基本使用流程,包括分支管理、远程仓库同步等,并通过实际案例演示了如何进行三路合并及解决历史文件删除后的恢复操作。同时,还提供了SSH配置及带认证克隆仓库的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

---------diff-----

git checkout master

git checkout -b test

git remote -v

git remote add https://github.com/openstack/neutron.git

git pull github TAG_NUM

git branch

git diff test your_branch



Tree ares:

1. Working directory

2. Staging areas / Index

3. Repository


Three objects (DAG):

1. Commit

2. Tree

3. Blob

(4. Tag)

Every commit holds a tree, and every tree may contain any number of other trees and blobs in its leaves.


Branch --> C1(Commit -- > tree --> blob)


Three-way merge


道生一,一生二,二生三,三生万物...

#################################

test history:

rm main.c
git checkout -f HEAD


git hash-object main.c


git add main.c
git commit -m "This is 1 commit"


ll .git/objects/
find .git/objects/ -type f
find .git/objects/ -type f | wc -l
git show 91c8
git cat-file -t a832
git ls-tree a832
git show -s --pretty=raw 10ea


git tag v1.0
git tag -a milestone1.0 -m "This is the first stable version"
git archive --format=tar --prefix=rubyobjectname/ v1.0 | gzip > /tmp/ruby1.0.tar.gz

git branch
git branch testing
cat .git/HEAD
ls .git/refs/heads/
cat .git/refs/heads/master
cat .git/refs/heads/testing
git branch
git checkout testing
git checkout master
git merge testing
git branch -D testing



git clone http://username:password@github.com/****.git

and

.ssh/config

HOST github.com

PORT 8022



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值