git的日常

Git is locally enabled, meaning that you can version-control items just on your desktop, just with a single piece of software available on the command line. It doesn't require a complicated server software to be effective. But if you need a dedicated server to collaborate with your colleagues, it'll be available in a few minutes.

$git init myproject
the setup of the version-control structures. it create a directory that contains your source code files as well as the control files (storing the historical elements / snapshot).

$git add .            // it's a command that actually notices the files which're meant to a kind of holding zone ready to permanently be commited.
$git commit -m"Importing all the code"
                    // and then nicely aligning with the word we just used, commit, is the keyword that actually permanently record the historical version (or snapshot).
It's people working at almost different times, but with overlaps, and all wanting to bring back their work to the home base to have it cooperated in a primary copy of the project.

Each fellow worker takes a personal copy of the files as they see'em .. time to perform their own enhencement for them, then bringing'em back to the central copy and wanting to unify (the technical term is 'merge') those changes with the primary copy of the docs/imgs/src. It's this overlaping time and almost parallel work that complicates things.

doug can work on his master branch, or 'arm' of the project

doug+$git checkout master
doug+$git commit -a -m"My new logo"        // add some new graphical work, such as logo (PS: add to where?)
doug+$git push                            // and then sending'em to central server, now adding that network component to the idea of the version-control

dana+$git checkout -b danasfeature
dana+$git commit -a -m"My feature code"    // contrib his feature work
dana+$git push origin danasfeature        // and then bring that into the central server base copy

doug+$git pull        // [critial] bring all the code to the unified set, merging together both doug and dana's work
doug+$git merge danasfeature
------------------------------------------------------------

$git add -p MyReport.markdown
$git commit -m"Added latest stats"

$git log --graph --decorate --abbrev-commit --all --pretty=oneline
------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值