git

GIT

git 指定目录 拉取文件

  • 在项目目录下git 初始化
git init 
  • 修改.git文件夹里面的 config 文件 .git/config 启用 sparse checkout(稀疏检出)
#文件config 的初始化内容
[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
#修改 config 后的内容  url 修改为需要拉取的仓库地址
[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    sparsecheckout=true
[remote "origin"]
    url = http://git.xxxxx.com/xxxx/xxxx.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
  • 在 .git/info 创建 sparse-checkout 文件,在文件里面指定需要拉取的目录或内容
/abc/
  • git pull拉取代码

git 设置不用每次都输入 账号密码

  • git bash进入你的项目目录
  • git config --global credential.helper store

你可能感兴趣的:(git)