Linux git安装与部署
目录
git安装
1、下载与安装
2、配置git账号信息
创建本地仓库
1、创建本地代码库文件夹
2、创建项目代码本地仓库文件夹
3、进入到projCode目录下,创建git本地仓库
4、创建过滤文件.gitignore
5、添加.gitignore到git暂存区
6、提交.gitignore
7、将项目代码移动到projCode目录下
8、将项目代码添加git暂存区
9、提交项目代码到仓库中
git本地仓库操作常用命令
查看哪些文件做了修改(与版本做对比)
查看变更摘要
查看某文件变更内容
回退某文件的所有变更
将文件添加到git暂存区
文件添加到git暂存区后,想将其从暂存区中移出(撤销git add操作)
提交到版本库
取消某文件的版本追踪
查看仓库的提交日志
查看某项提交详情
查看某文件的提交日志
Qt Creator中使用git
1、启用git插件
2、使用git插件操作本地仓库(支持git部分功能)
git安装
1、下载与安装
sudo apt install git
2、配置git账号信息
#设置邮箱
git config --global user.email "xxx@xxmail.com"
#设置用户名
git config --global user.name "yourName"
创建本地仓库
1、创建本地代码库文件夹
mkdir repos
2、创建项目代码本地仓库文件夹
mkdir projCode
3、进入到projCode目录下,创建git本地仓库
git init
4、创建过滤文件.gitignore
.gitignore内容可参考如下:
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
*.stackdump
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
#x64/
#x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studio 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
#*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
#