git版本控制管理实践-3

Git命令详解
本文详细介绍了Git的基本使用方法,包括如何通过git add和git commit进行文件提交的两步操作,以及如何将这两个步骤合并为一步使用git commit -a完成。此外还讲解了远程仓库的两种形式及其管理方式,以及如何克隆远程仓库。

git -m 和git -a -m(-am) . 的区别?

usally two steps to commit files to respository:
first, git add somefiles/dir;
second, git commit -m 'commit log messages'
but, the two steps above can be executed as one action: git -am commit somefiles/dir.
that is to say, if there are not new files to be tracted, 'git -am commit' will add those modified files to index and commit them.

Both 'dnf' and 'git' and 'systemctl' are applications, they are followed by commands. Their formats are similar: git/dnf/systemctl list-unit/start some-service [options] command [...]. So, in normal case, options are put'git/dnf' back, not behind 'command'.
In command "dnf list",the list works like command 'ls'.
The command 'Systemctl' works like 'control panel' in Windows OS. It does some work about system controls, such as service management.

821299-20161102191636533-1697832629.png

remote repository has two forms: project development with working tree and only for codes share in team development.

the former is called remote developing repos, and the latter is named bare codes-share repos. developing repos are often cloned by git client. bare codes share repos are only used to share codes in most cases, which do not include working directory. (in most cases: for verb. adv. , but 'for the most part', describes noun.)

Remote Repos Management

Sometimes, a cloned git repos is named ***.git, but the repo is a directory actually.
In general, 'repo' refers the directory which includes '.git'. And repo is named ***.gitfor easy recognition.

A repo may be cloned into an existing specified local directory, but this is only allowed when the directory is empty. Repo is cloned into a newly created directory whose name is same as the remote one by default, so, a local directory will have to be written explictly. The command perhaps looks like this: git clone repo-urls

In general, URLs contain information about the transport protocol, the address of the remote server, and the path to the repository.
821299-20161102201636643-576587250.png


Scp and Ssh

Scp: secure cp (for file trans-mission between a remote network host and a local host). Referenced article's address: http://www.cnblogs.com/ilikeballs/p/5113349.html. The usage of Scp is almost same as cp, so it is easy.

If the transport protocol is ssh When cloning a remote repo, the remote repo info may be alternatively applied scp-like syntax.

About transport protocol:

  • Only git and ssh support ~username expansion. '~' is the current user's home directory. '~username' can also be used to refer the specified user's home directory.
    821299-20161102211909908-1784684619.png

  • Ssh protocol is also allowed to use scp-like syntax. That is, ssh protocal 'ssh://' can be omitted.

  • For local repositories, use the form like this '/path/to/repo.git' or like this 'file:///path/to/repo.git'

The three syntax alternatives(adj. n. 可替换的事物)above are showed in the following figure:
821299-20161102213335471-1024264051.png

  • comma is ',' colon is ':' semicolon is ';' period is '.'

Usually, the suffix['s^fiks] '-d' indicates that program is a deamon, such as httpd, sshd. Oppositely, no '-d' suffix shows that program is a client application, such as ssh. Further more, daemon command files reside in directory "/usr/sbin/", client command files reside in directory "/usr/bin/ .
821299-20161103082800643-961276850.png

mariadb-server is a client-server implementation consisting of(using active voice not passive voice) a mariadb server(mysqld) and other relative files, such as many different client programs and libraries.

'epoch': ['ip2k], 时代, 纪元...

In English, there is no bookname brackets, that expresses in italic font. In American English, quotes are double-quotes, however, in England English, quotes are single-quotes. Of course, both single quote and double quote are used at the same time.


How to resolve the error: "cann't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'(2 no such file or directory) "
821299-20161103084623705-126566821.png

The command 'dnf install mariadb-server' will introduce the following packets into your computer:
821299-20161103085155221-1130440728.png

The two configures above show that after installing "mariadb-server", the directory '/usr/lib/' has 'mysql' sub-directory.

In Fedora 23, service daemon files, such as httpd, sshd, mysqld etc do not reside in the directory "/etc/rc.d/init.d/, but are put in the path: /usr/lib/systemd/...(-d shows that this is daemon about system)
821299-20161103104732705-427621168.png

821299-20161103104919518-1913551704.png

The content in the [square brackets] is named 'group'
821299-20161103105639315-2133438585.png

Readline is a cross-platform open-source gnu library. It is mostly used in command line programs in linux and other unix-like OS.

To check mysql/mariadb version, use command "status" or "selecct version() as ver" after login/connect to sql server.
In sql server, execute "system (or \!) + shell-command" to run system command.


How to create a remote repo for cloning?

git repository is indeed directory "/some/path/to/working-dir/.git"

821299-20161103213647783-405571890.png

After add a remote repository, the file .git/config is appended [remote]group:

821299-20161103215057268-858589534.png

To git remote push local master branch to remote origin repo, make sure that the sshd service has been started and is running.

821299-20161104143640127-1686839815.png

821299-20161104143649549-1068833531.png

821299-20161104144211596-1594135326.png

转载于:https://www.cnblogs.com/bkylee/p/6022984.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值