master

从GitHub存储库下载单个文件夹或目录

痴心易碎 提交于 2020-01-23 02:35:47
如何从 GitHub 上托管的远程Git存储库中仅下载特定文件夹或目录? 假设示例GitHub存储库位于此处: git@github.com:foobar/Test.git 其目录结构: Test/ ├── foo/ │ ├── a.py │ └── b.py └── bar/ ├── c.py └── d.py 我只想下载 foo 文件夹,而不克隆整个Test项目。 #1楼 这是SVN比Git更好的少数几个地方之一。 最后,我们倾向于以下三种选择: 使用wget从GitHub抓取数据(使用原始文件视图)。 让上游项目将所需的数据子集发布为构建工件。 放弃并使用完整的结帐。 在第一个版本中这是一个很大的成功,但是除非您获得大量流量,否则在后续版本中不会有太多麻烦。 #2楼 如果要下载的目录是一个单独的库,最好创建另一个git repo,然后再使用git子模块功能。 当然,您必须是您想要的初始回购的所有者 #3楼 对于通用git Repo: 如果要下载文件,而不是使用历史记录克隆存储库,则可以使用 git-archive 。 git-archive 创建git存储库的压缩zip或tar存档。 一些使它特别的东西: 您可以选择git存储库中要归档的文件或目录。 它不会在运行它的存储库中存档 .git/ 文件夹或任何未跟踪的文件。 您可以存档特定的分支,标记或提交。

Git报错:git pull时报There is no tracking information for the current branch.

二次信任 提交于 2020-01-23 01:40:44
问题描述:提示branch没有跟踪信息 解决方案 1.直接指定远程分支 git pull origin master 2.先指定本地master到远程的master,然后再去pull git branch --set-upstream-to=origin/master master git pull 来源: CSDN 作者: Creepin_ 链接: https://blog.csdn.net/Creepin_/article/details/103766891

GITHUB push code 2020年1月22日

主宰稳场 提交于 2020-01-22 19:24:32
在和籽藤沟通之后,意识到了在GITHUB上记录学习过程的重要性,为了记录,也为了激励坚持学习,之后会记录每次学习过程。 目的:将Python 代码push到github push 成功的前提: 1. 初始化 2. 登录 3. 加载要提交的文件 4. 关注远程仓库 5. 本地update到最新版本的项目 1. git push -u origin master 报错:fatal: not a git repository (or any of the parent directories): .git = git init 2. git push -u origin master 报错: *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address () = git config --global user

git常用命令

て烟熏妆下的殇ゞ 提交于 2020-01-22 18:31:09
# 创建SSH Key(生成id_rsa私钥和id_rsa.pub公钥) ssh-keygen -t rsa -C "daiyuanpei@qq.com" # 查看所有分支 git branch -a # 切换分支到sign分支 git checkout remotes/origin/sign # 查看版本库状态,什么被修改过但还没提交的 git status # 查看当前相对上一次提交修改的内容 git diff # 把文件添加到仓库,此时是将修改添加到暂存区,可add多次 git add Task5.php # 把文件提交到仓库,此时是把暂存区的所有内容提交到当前分支,可一次提交多个文件 git commit -m "本次提交的备注" # 将本地的内容推送到远程库分支上 # 第一次推送分支所有内容 git push -u origin 分支名字 # 推送最新修改 git push origin 分支名字 git push origin HEAD:refs/for/xxx_1-0-163_BRANCH # 克隆代码 git clone 需要克隆的仓库地址 git clone http://gitlab.baidu.com/php/php.git # 查看远程仓库信息 git remote # 查看更加详细的信息 git remote -v # 版本回退 #

git push报错! [rejected] master -> master (non-fast-forward)的有效解决方案

纵然是瞬间 提交于 2020-01-22 16:42:16
在对本地的代码add 和 commit后 进行 git push操作报错 ! [rejected] master -> master (non-fast-forward) 解决方案 1、git pull origin master --allow-unrelated-histories //把远程仓库和本地同步,消除差异 2、重新add和commit操作 3、git push origin master 来源: CSDN 作者: Boxbiu 链接: https://blog.csdn.net/Boxbiu/article/details/104070258

git使用步骤

混江龙づ霸主 提交于 2020-01-22 16:09:47
git步骤: 1.git add 某个文件名 git add . :他会监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区,包括文件内容修改(modified)以及新文件(new),但不包括被删除的文件。 2.git commit "文件描述" 3.当commit的源文件再次修改过时,需要再写一次 git commit -am 文件名 4.与远程建立了联系 git remote add origin https://github.com/heidao10duan/myLrose 5.将文件push到一个分支(我新创建的) git pull origin master //将GitHub仓库更新到本地 git push origin master:jyp_cleanDetail或git push origin master 错误整理 错误一:我写的了git add . 出现以下的报错,git status 查看没有添加本地仓库中. 报错信息warning: CRLF will be replaced by LF in XXX . The file will have its original line endings in your working directory. 解决:git config core.autocrlf false //将设置中自动转换功能关闭 备注

MHA快速搭建

断了今生、忘了曾经 提交于 2020-01-22 14:20:29
很早之前写过MHA的文章,但是常常在技术群看到有同学问MHA搭建的问题,不是权限问题就是配置问题,我在这里就再次一写下配置过程以及快速的搭建。如果想知道更多的细节与原理,请参考: MySQL高可用架构之MHA 环境: 1主1从,manager放在从库。 主库:192.168.0.10 从库:192.168.0.20 两台机器的mysql安装完成初始化以后进行复制搭建,首先登录主库(192.168.0.10),查看pos点: mysql> show master status; +------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +------------------+----------+--------------+------------------+-------------------+ | mysql-bin.000001 | 154 | | | | +------------------+----------+--------------+------------------+---------------

Dungeon Master (简单BFS)

独自空忆成欢 提交于 2020-01-22 14:03:00
Problem Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south, east, west, up or down. You cannot move diagonally and the maze is surrounded by solid rock on all sides. Is an escape possible? If yes, how long will it take? Input The input consists of a number of dungeons. Each dungeon description starts with a line containing three integers L, R and C (all limited to 30 in size). L is the number of levels making up the dungeon. R and C

redis 集群 failover 源码分析

a 夏天 提交于 2020-01-22 13:18:21
failover 以后都在 github 更新,请戳 redis 集群->failover contents 需要提前了解的知识 PFAIL FAIL ELECT 需要提前了解的知识 cluster->reshard cluster->gossip prerequisites->cluster 中展示了示例集群的配置 如果我们增加一个新的节点 127.0.0.1:7003 127.0.0.1:7003> CLUSTER MEET 127.0.0.1 7000 OK 127.0.0.1:7003> CLUSTER NODES 75ddecf9169096eeff03ec60f868859333c824a1 127.0.0.1:7003@17003 myself,master - 0 1579513065000 0 connected ba060347b647e2cb050eea666f087fd08d4e42d7 127.0.0.1:7001@17001 master - 0 1579513065256 2 connected 5461-10922 c62cfa7c26ec449462cceb5fd45cac121d866d44 127.0.0.1:7002@17002 master - 0 1579513066283 3 connected 10923-16383

Git 图解剖析

时间秒杀一切 提交于 2020-01-22 09:49:50
  git中文件内容并没有真正存储在索引( .git/index )或者提交对象中,而是以blob的形式分别存储在数据库中( .git/objects ),并用SHA-1值来校验。 索引文件用识别码列出相关的blob文件以及别的数据。对于提交来说,以树( tree )的形式存储,同样用对于的哈希值识别。树对应着工作目录中的文件夹,树中包含的 树或者blob对象对应着相应的子目录和文件。每次提交都存储下它的上一级树的识别码。   如果用detached HEAD提交,那么最后一次提交会被the reflog for HEAD引用。但是过一段时间就失效,最终被回收,与 git commit --amend 或者 git rebase 很像。   git 模型可以抽象为 远程仓库——remote , 本地三级仓库: level1——working directory level2——stage(index) level3——repository(History) git 各个命令可以理解为在各个仓库间转移数据,各个命令对应对每个仓库输入输出。   便于记忆可以简单分为 低level输入和 高level输入, 注意各level并不一定是相邻的level间转移,可以跨level转移,通过git命令的参数选项来实现,   如常见的 git checkout git reset git