github是一个很实用的代码管理工具,代码的管理我们不仅限于本地代码的管理,为了做好备份与下载,我们还需要将本地代码上传到远程仓库进行备份管理。在代码的上传前提是你已经进行ssh key绑定了,具体绑定方法见博客GitHub的SSH的绑定 。
第一步:git服务器上建立远程仓库。
我们如果想要把本地代码上传到远程,那么远程就必须有一个与之相同的仓库。所以,我们首先要在远程建立一个远程仓库。下方两个地方都可以。
然后写上仓库的名字,我这里写上hevcParser(我这里提示已经存在,因为我已经有了这个仓库,这里只是为了演示),并且写上该仓库的描述。就OK了。
第二步:git本地仓库的初始化以及远程仓库的上传。
我这里建立了一个文件夹hevcParser文件夹(与远程仓库的仓库名字一样),里面就是需要上传的文件。
初始化仓库:由于hevcParser只是一个普通的文件夹,那么如何使其变成一个git仓库呢?
[root@localhost packetHdr]# git init
使用git init初始化,然后再看这个hevcParser文件夹。发现多了.git的文件夹(大多数是隐藏文件),说明初始化成功。
接下来,就是需要把本地git仓库与远程的仓库联系在一起。
[root@localhost packetHdr]#
[root@localhost packetHdr]# git status
fatal: Not a git repository (or any of the parent directories): .git
[root@localhost packetHdr]# git init
初始化空的 Git 版本库于 /root/mcoco/packetHdr/.git/
[root@localhost packetHdr]#
[root@localhost packetHdr]# git config --global user.name "shenbinghua"
[root@localhost packetHdr]# git config --global user.email "shenbinghuasbh@163.com"
[root@localhost packetHdr]#
[root@localhost packetHdr]# git remote add origin git@github.com:shenbinghua/packetHdr.git
[root@localhost packetHdr]#
[root@localhost packetHdr]#
[root@localhost packetHdr]# git status
# 位于分支 master
#
# 初始提交
#
# 未跟踪的文件:
# (使用 "git add <file>..." 以包含要提交的内容)
#
# CMakeLists.txt
# build/
# src/
# test/
提交为空,但是存在尚未跟踪的文件(使用 "git add" 建立跟踪)
[root@localhost packetHdr]#
[root@localhost packetHdr]# git add CMakeLists.txt
[root@localhost packetHdr]# git add build/
[root@localhost packetHdr]# git add src/
[root@localhost packetHdr]# git add test/
[root@localhost packetHdr]#
[root@localhost packetHdr]# git commit -m"用于HDR信息的写入(重写sps、sei等信息 )"
[master(根提交) 4d5b44f] 用于HDR信息的写入(重写sps、sei等信息)
50 files changed, 5752 insertions(+)
create mode 100755 CMakeLists.txt
create mode 100644 build/CMakeCache.txt
create mode 100644 build/CMakeFiles/3.12.2/CMakeCCompiler.cmake
create mode 100644 build/CMakeFiles/3.12.2/CMakeCXXCompiler.cmake
create mode 100755 build/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_C.bin
create mode 100755 build/CMakeFiles/3.12.2/CMakeDetermineCompilerABI_CXX.bin
create mode 100644 build/CMakeFiles/3.12.2/CMakeSystem.cmake
create mode 100644 build/CMakeFiles/3.12.2/CompilerIdC/CMakeCCompilerId.c
create mode 100755 build/CMakeFiles/3.12.2/CompilerIdC/a.out
create mode 100644 build/CMakeFiles/3.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
create mode 100755 build/CMakeFiles/3.12.2/CompilerIdCXX/a.out
create mode 100644 build/CMakeFiles/CMakeDirectoryInformation.cmake
create mode 100644 build/CMakeFiles/CMakeOutput.log
create mode 100644 build/CMakeFiles/Makefile.cmake
create mode 100644 build/CMakeFiles/Makefile2
create mode 100644 build/CMakeFiles/TargetDirectories.txt
create mode 100644 build/CMakeFiles/cmake.check_cache
create mode 100755 build/CMakeFiles/feature_tests.bin
create mode 100644 build/CMakeFiles/feature_tests.c
create mode 100644 build/CMakeFiles/feature_tests.cxx
create mode 100644 build/CMakeFiles/packetHdr.dir/CXX.includecache
create mode 100644 build/CMakeFiles/packetHdr.dir/DependInfo.cmake
create mode 100644 build/CMakeFiles/packetHdr.dir/build.make
create mode 100644 build/CMakeFiles/packetHdr.dir/cmake_clean.cmake
create mode 100644 build/CMakeFiles/packetHdr.dir/depend.internal
create mode 100644 build/CMakeFiles/packetHdr.dir/depend.make
create mode 100644 build/CMakeFiles/packetHdr.dir/flags.make
create mode 100644 build/CMakeFiles/packetHdr.dir/link.txt
create mode 100644 build/CMakeFiles/packetHdr.dir/progress.make
create mode 100644 build/CMakeFiles/packetHdr.dir/src/packetHdr.cpp.gcno
create mode 100644 build/CMakeFiles/packetHdr.dir/src/packetHdr.cpp.o
create mode 100644 build/CMakeFiles/packetHdr.dir/src/pktH264.cpp.gcno
create mode 100644 build/CMakeFiles/packetHdr.dir/src/pktH264.cpp.o
create mode 100644 build/CMakeFiles/packetHdr.dir/src/pktH265.cpp.gcno
create mode 100644 build/CMakeFiles/packetHdr.dir/src/pktH265.cpp.o
create mode 100644 build/CMakeFiles/progress.marks
create mode 100644 build/Makefile
create mode 100644 build/cmake_install.cmake
create mode 100755 build/packetHdr
create mode 100644 src/common.h
create mode 100644 src/h2645_paramter.h
create mode 100644 src/packetHdr.cpp
create mode 100644 src/packetHdr.h
create mode 100644 src/parser_util.h
create mode 100644 src/pktH264.cpp
create mode 100644 src/pktH264.h
create mode 100644 src/pktH265.cpp
create mode 100644 src/pktH265.h
create mode 100755 test/hdr.h265
create mode 100755 test/test.h264
[root@localhost packetHdr]#
[root@localhost packetHdr]# git push origin master
Counting objects: 61, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (60/60), done.
Writing objects: 100% (61/61), 12.33 MiB | 576.00 KiB/s, done.
Total 61 (delta 9), reused 0 (delta 0)
remote: Resolving deltas: 100% (9/9), done.
To git@github.com:shenbinghua/packetHdr.git
* [new branch] master -> master
[root@localhost packetHdr]#
[root@localhost packetHdr]#
[root@localhost packetHdr]#
[root@localhost packetHdr]#