Article Directory
Transfer Protocol
There are two local transmission protocol is protocol dumb one is intelligent protocol
intuitive difference: dumb protocol transfer progress is not visible; intelligent transmission protocol visible.
Transmission speed: intelligent protocol is faster than the dumb protocol transfer speed.
It is easy to see intelligent protocol more in line with our needs
Team development, then need remote code hosting platform - GitHub or GitLab
Git features local backup to the remote
is easy to see which is the distributed nature of the differences and where one of svn
The git repository backup to the local
Cloned directly using the distal end of the warehouse (depot without bare work area) over the backup
Use backup dumb protocol
Use the following command:
git clone --bare /path/to/.git ya.git
The above command /path/to/.git git repository is the path of the backup file to the local ya.git
Bare warehouse parameters --bare means that without the work area
Using Smart Backup agreement
Use the following command:
git clone --bare file:///path/to/.git ya.git zhineng.git
Bring front git repository file: // prefix is the use of intelligent transmission protocol, transmission time progress bar
After the distal end of the new warehouse
git remote add zhineng file:///d/Documents/666-backup/zhineng.git/
When the local warehouse new branch, while the distal not added to it, direct push
git push zhineng
Tip of the above means that the use of a new branch locally git, you need to do associated with the remote branch. If there is no association, git will prompt you to add the associated display in the following operations.
When the association is aimed at the implementation of git pull, you do not need to specify when the corresponding remote branch git push operation, as long as you do not show specified, git pull, it will prompt you
View remote branch has been found over a push
Associated with the remote warehouse occur
frequently used commands
$ git remote -v
# 查看关联的远端
$ git remote add <name> file://<path(.git)>
# 与指定远端仓库发生关联
$ git push
# 按实际情况的提示继续 push 的操作
# 把本地的 commited 的文件,同步到远端仓库