Git - 初步

本文详细介绍了Git的基本使用方法,包括配置、基本操作、分支管理、冲突解决及远程仓库同步等内容。
github 使用:
1 新建项目
2 执行页面上的配置命令

global setup               *          # 全局配置


# 全局配置,在本机所有项目有效 (若项目有显示配置,则以项目配置为准)
git config --global user.name "my name"               #  ./gitconfig  -->git 根目录下
git config --global user.email johndoe@example.com    #./gitconfig  -->git 根目录下
/* 形如
[user]
email = "addr@gg.cn"
email = "name"
*/


# 局部(单个项目)配置 , 若全局配置过,则不必配置
git config user.name "my name"               #  ./git/config  -->git 根目录下
git config user.email johndoe@example.com    #./git/config  -->git 根目录下


add your public key               #
ssh-keygen                # 生成公钥 - 默认全部回车即可
 # c:/Users/admin/.ssh/id_rsa
next steps                 *      # 这两项直接执行命令即可
mkdir first-proj
cd first-proj
touch README
git add README
git commit -m "first commit"
git remote add origin git@github.com:searchjack/first-proj.git
git push -u origin master
-- 取回服务器信息
git fetch origin
git rebase origin/master
git push
-- 冲突
git fetch origin
git rebase origin/master
vim xxx.file
git add .
git rebase --continue
git push




-- 删除文件后,取回
git checkout -f HEAD
find .git/objects/ -type f
git show -s --pretty=raw <hash>
-- 查看对象类型
git cat-file -t <hash>
-- tag     commit tag 标签
git tag v1.0                                                      -- 这是指针类型的 tag
cat .git/refs/tags/v1.0
git tag -a milestone1.0 -m "This is the first stable version"     -- 对象型的 tag
-- 从 tag 提供源码,打包  < proj 为项目
git archive --format=tar --prefix=proj/ v1.0 | gzip > /tmp/proj1.0.tar.gz
-- 从 tag 检出
git checkout v1.0  # .git/refs/tags/v1.0
-- 分支 master | testing
- 合并分支
git branch
git checkout master
git merge testing
- 删除分支
git branch -D testing
- 合并分支 冲突
-- rename
- 事先在磁盘上 rename a.c to b.c
git rm a.c
git add b.c
git status
--
git mv a.c b.c
git status
--
git add x.c -s  # -s means split
git diff --color-words x.c
--
git checkout -- dirName/
git checkout -- xx.c    # -- 表示在当前分支检出修改
-- unstage one file/directory - 在 stage index 进行
git reset HEAD xxx.c
-- 修改最近一个commit,将本commit附加到最近的commit
git commit --amend -m "update info" -- 可以在这里修改commit信息
git commit --amend -m "changed info"
-- git diff --staged
git log
git checkout <SHA> -- xxx.c
git status
git diff --staged
git reset HEAD xxx.c   # reset xxx.c from SHA - HEAD
git checkout -- xxx.cn
-- revert
git log  # get the latest commit SHA
git revert <SHA>   # pop up a commit message
git log
-- git reset --soft    # does not change staging index or working directory
git log # get SHA
cat .git/HEAD # in master branch
cat .git/refs/heads/master
git reset --soft <SHA>    # the history <SHA>
cat .git/refs/heads/master
- something changed
git status
git diff --staged
-
get reset --soft <SHA>   # get back to the latest history
git status
-- git reset --mixed
git reset --mixed <SHA>   # changes staging index to match repository,
 # does not change workiing directory.
-- reset --hard           # changes staging index and working directory to
                          # match repository.
git log
git reset --hard <SHA>    #
git log
git status # nothing to commit
git reset --hard <SHA>    # 回到丢失的 commit, 如果还能记住或找到之前的 SHA,在 repository 中并没有将其删除
-- git clean    # remove files which untracked, so it would not exist in working space,stage index and repository
git status   # some file is untracked
git clean
git clean -n
git add aFileToDelete.c
git clean -f
git status
-- ignore file
project/.gitignore
·very basic regular expressions
  * ? [aeiou] [0-9]
·negate expressions with!
  *.php
  !index.php
·ignore all files in a directory with trailing slah
  assets/videos/
·comment lines gegin with #, blank lines are skipped


- in the working directory
vim .gitignore
name.txt
*.cc
# Comment
tmpfile.txt
.SD_Store
*.zip
*.gz
log/*.log
log/*.log.[0-9]
assets/photoshop/
assets/videos
!assets/videos/tour_*.mp4
# question: would log/archive/access.log be ignored? No.


http://github.com/github/gitignore


- globally ignore files
vim .gitignore_blobal
.DS_Store
.Trashes
.Spotlight-v100
git config --global core.excludesfile ...\.gitignore_global     # 在git 的根目录执行 / 其目录下有 .gitconfig 文件
cat .gitconfig


- ignore tracking files
# add a.c to repository, "git add a.c | git commit"
# remove it, and keep it in working space
git rm --cached a.c
git add .gitignore
git commit -m "remove a.c from index"
git status
-- Tracking empty directories
touch .gitkeep   # 在空目录下建空文件
git status
git add <./...>
git commit -m "add 'empty' directory with .gitkeep file in it"
-- navigating the commit tree
-- refrencing commits
git help ls-tree
git ls-tree HEAD
git ls-tree master
git ls-tree master assets/
git ls-tree master^ assets/   # parent commit
git ls-tree <SHA>
git log --oneline
git log --oneloine -3
git log --since="2012-10-23"
git log --until="2012-10-23"
git log --since="3 weeks ago" --until="2 days ago"
git log --since=3.weeks --until=2.days
git log --author="Kevin"
git log 332983..acf8750 --oneline  # two SHA
git log c4913e.. index.html        # view the log of a file up to now
git log -p c4913e.. index.html     # show changes
git log --start --summary
git log --format=oneline
git log --format=short
git log --format=full
git log --format=midum
git log --format=raw
git log --format=email
git log --graph
git log --oneline --graph --all --decorate
pwd
git log --oneline
git show SHA
-
git show --format=oneline HEAD
git show --format=oneline HEAD^
git show --format=oneline HEAD^^
git show --format=oneline HEAD~3
-
git help show
git show SHA
git diff       # return the changes that between working directory and stage index
git diff --staged
git diff --cached
git log --oneline
git diff SHA   # SHA reference to commit
               # return differences between the directory at that point 
  # in time and my current working directory.
git diff SHA tours.html          # show the changes of one file
git diff SHA..SHA
git diff SHA..SHA tours.html     # show the changes of one file
git diff SHA..HEAD
git diff SHA..HEAD^^
git diff --stat --summary SHA..HEAD
git diff -b SHA..HEAD                       # 等效于下一条命令
git diff --ignore-space-change SHA..HEAD
git diff --ignore-all-space SHA..HEAD
git diff -w SHA..HEAD                        # 等效于上一条命令
-- create branch
git branch
cat .git/HEAD
ls -la .git/refs/heads
cat .git/resfs/heads/master
git log --oneline
git branch new_feature
git branch
cat .git/HEAD
git checkout new_feature
git branch
cat .git/HEAD
# change a file
git status
git commit -am "message"
git log --oneline
git checkout master
git log --oneline
- git checkout new_feature
git show HEAD
it log --graph --oneline --decorate --all
-- 
.bash_profile
export PS1='\W$(__git_ps1 "(%s)") > '
source ~/.bashprofile   # execute the script
-- merging code  # merge different branchs in
- merge the changes into the master branch
git branch
git diff master..seo_title
git checkout master
git merge seo_title # fast forward
git log
git diff master..seo_title
git branch --merged
#
-- use fast-forward merge
git log seo_title --oneline -3
git log master --oneline -3
git merge --no-ff branch   # no-ff option forces Git to create a merge commit anyway
git merge --ff-only branch # only do the fast-forward merge, otherwise abort
-- merging conflicts
git checkout seo_title # update the a.file
git commit -am "update the a.file"
git checkout master # update the a.file too
git commit -am "update the a.file too"
git merge seo_title # CONFLICT
git merge --abort
-
git status
git log --oneline
git merge seo_title # abort merge


# resolve the conflicts manually
# use a merge tool
git status
git add a.file
git status
git commit
gti status
git log --oneline -4
git branch --merged # --> seo_title
-
git log --graph --oneline --all --decorate
-
# git mergetool --tool=xxx
git mergetool
-- reduce merge conflicts
# keep lines short
# keep commits small and focused
# beware stray edits to whitespace
  - spaces,tabs,line returns
# merge often
# track changes to master
-- saving changes in the stash
# Let's try making a change,and then we can store it in the stash
git checkout shorten_title
git branch --merged
# change b.file
git status
git checkout master # error
# commit changes or stash them
git stash save "changed b.file"
git status # nothing to commit
git log --oneline -3
-
git stash list # stash@{0}:
git checkout master
git stash list # stash@{0}: 
  # it is available
git stash show stash@{0}
git stash show -p stash@{0}
git stash pop   # - put stash in the work directory  - remove it from the stash
git stash apply # /                                  - keep the copy in the stash
git stash pop stash@{0}
git stash list
git stash save "save stash again"
git checkout shorten_title
git status
git stash list
git stash apply
git stash list
-- deleting stashed changes
git stash list
git stash drop stash@{0}  #
git stash list
-
# change c.file
git status
git stash save "change c.file"
git stash list
git status
# change d.file
git status
git stash save "change d.file"
git stash list
git stash clear # clear all of the stahs
git stash list
-- using local and remote respositories
# pull
# fetch
git remote
git remote add <name> <url>
git remote
git remote -v
cat .git/config
git remote rm origin
cat .git/config
-
# git push -u origin # push to remote
git branch
git push -u origin master
-
cat .git/config
ls -la .git/refs/remotes
ls -la .git/refs/remotes/origin
cat .git/refs/remotes/origin/master
git branch
git branch -r # remote
git branch -a # all
--    从服务器检出源码
git clone https://github.com/... lynda_version
# tracking remote branches
-- fetching changes from remote
git branch
git branch -r
git fetch # It is'n  hrmful
git log --oneline -5 origin/master
git branch
git branch -r
git log --oneline -5 master
-- merging in fetched changes
git branch -a
git diff origin/master..master
git merge origin/master
git log --oneline -3 master

# git pull = git fetch + git merge


-- checking out remote branches
git branch
git branch -r
git branch non_tracking origin/non_tracking
cat .git/config
git branch -d non_tracking # -d : delete
gir branch -r
git checkout -b non_tracking origin/non_tracking
git branch
git checkout master
git branch
-- pushing to an updated remote branch
# 本地与远程在某一个commit 不一致
# fetch - merge - push
git branch -a
git push origin :non_tracking # delete一个远程分支,本地仍然保存有这个分支
git branch -r
git push origin non_tracking:non_tracking   # non_tracking --> non_tracking  =>  local branch --> remote branch
# push to origin my local branch non_tracking, to remote branch
# :non_tracking   => it means to delete the remote branch 'non_tracking'
git push oring non_tracking
git push oring --delete non_tracking # delete a branch from local and remote
git branch -r
#
-- my work
git checkout master
git fetch
git merge origin/master
git checkout -b feedback_form
git add feedback.html
git commit -m "Add customer feedback form"
git fetch
git push -u origin feedback_form
-- a collaboration workflow
the coworker
git checkout master
git fetch
git merge origin/master
git checkout -b feedbakc_form origin/feedback_form
git log
git show 8387f0
git commit -am "Add tour selector to feedback form"
git fetch # make sure there is no new changes come in
git push
-- my work
git fetch
git log -p feedback_form..origin/feedback_form
git merge origin/feedback_form
git checkout master
git fetch
git merge origin/master
git merge feedback_form
git push
-- setting up aliases form common commands
git config --global alias.st "status"  # ~/.config
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.br branch
git config --global alias.df diff
git config --global alias.dfs "diff --staged"
git config --global alias.logg "log --graph --decorate --oneline --abbrev-commit --all"
git logg  #
--
graphical user interface for mac
gitX
gitHub
tower
smartGit
gitbox


graphical user interface for windows
tortoiseGit
gitHub
git extensions
smartGit
git hosting companies
gitHub gitHub.org
bitbucket bitbucket.org
gitorious gitorious.org
git self-hosting
gitosis
gitolite




<================= finished   :  Lynda.com : git essential training
git help <log>




SVN
sc create
svnadmin
svn 地址: svn://localhost/proj_name
权限:项目仓库/conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
标题SpringBoot智能在线预约挂号系统研究AI更换标题第1章引言介绍智能在线预约挂号系统的研究背景、意义、国内外研究现状及论文创新点。1.1研究背景与意义阐述智能在线预约挂号系统对提升医疗服务效率的重要性。1.2国内外研究现状分析国内外智能在线预约挂号系统的研究与应用情况。1.3研究方法及创新点概述本文采用的技术路线、研究方法及主要创新点。第2章相关理论总结智能在线预约挂号系统相关理论,包括系统架构、开发技术等。2.1系统架构设计理论介绍系统架构设计的基本原则和常用方法。2.2SpringBoot开发框架理论阐述SpringBoot框架的特点、优势及其在系统开发中的应用。2.3数据库设计与管理理论介绍数据库设计原则、数据模型及数据库管理系统。2.4网络安全与数据保护理论讨论网络安全威胁、数据保护技术及其在系统中的应用。第3章SpringBoot智能在线预约挂号系统设计详细介绍系统的设计方案,包括功能模块划分、数据库设计等。3.1系统功能模块设计划分系统功能模块,如用户管理、挂号管理、医生排班等。3.2数据库设计与实现设计数据库表结构,确定字段类型、主键及外键关系。3.3用户界面设计设计用户友好的界面,提升用户体验。3.4系统安全设计阐述系统安全策略,包括用户认证、数据加密等。第4章系统实现与测试介绍系统的实现过程,包括编码、测试及优化等。4.1系统编码实现采用SpringBoot框架进行系统编码实现。4.2系统测试方法介绍系统测试的方法、步骤及测试用例设计。4.3系统性能测试与分析对系统进行性能测试,分析测试结果并提出优化建议。4.4系统优化与改进根据测试结果对系统进行优化和改进,提升系统性能。第5章研究结果呈现系统实现后的效果,包括功能实现、性能提升等。5.1系统功能实现效果展示系统各功能模块的实现效果,如挂号成功界面等。5.2系统性能提升效果对比优化前后的系统性能
在金融行业中,对信用风险的判断是核心环节之一,其结果对机构的信贷政策和风险控制策略有直接影响。本文将围绕如何借助机器学习方法,尤其是Sklearn工具包,建立用于判断信用状况的预测系统。文中将涵盖逻辑回归、支持向量机等常见方法,并通过实际操作流程进行说明。 一、机器学习基本概念 机器学习属于人工智能的子领域,其基本理念是通过数据自动学习规律,而非依赖人工设定规则。在信贷分析中,该技术可用于挖掘历史数据中的潜在规律,进而对未来的信用表现进行预测。 二、Sklearn工具包概述 Sklearn(Scikit-learn)是Python语言中广泛使用的机器学习模块,提供多种数据处理和建模功能。它简化了数据清洗、特征提取、模型构建、验证与优化等流程,是数据科学项目中的常用工具。 三、逻辑回归模型 逻辑回归是一种常用于分类任务的线性模型,特别适用于二类问题。在信用评估中,该模型可用于判断借款人是否可能违约。其通过逻辑函数将输出映射为0到1之间的概率值,从而表示违约的可能性。 四、支持向量机模型 支持向量机是一种用于监督学习的算法,适用于数据维度高、样本量小的情况。在信用分析中,该方法能够通过寻找最佳分割面,区分违约与非违约客户。通过选用不同核函数,可应对复杂的非线性关系,提升预测精度。 五、数据预处理步骤 在建模前,需对原始数据进行清理与转换,包括处理缺失值、识别异常点、标准化数值、筛选有效特征等。对于信用评分,常见的输入变量包括收入水平、负债比例、信用历史记录、职业稳定性等。预处理有助于减少噪声干扰,增强模型的适应性。 六、模型构建与验证 借助Sklearn,可以将数据集划分为训练集和测试集,并通过交叉验证调整参数以提升模型性能。常用评估指标包括准确率、召回率、F1值以及AUC-ROC曲线。在处理不平衡数据时,更应关注模型的召回率与特异性。 七、集成学习方法 为提升模型预测能力,可采用集成策略,如结合多个模型的预测结果。这有助于降低单一模型的偏差与方差,增强整体预测的稳定性与准确性。 综上,基于机器学习的信用评估系统可通过Sklearn中的多种算法,结合合理的数据处理与模型优化,实现对借款人信用状况的精准判断。在实际应用中,需持续调整模型以适应市场变化,保障预测结果的长期有效性。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值