branch

git 学习使用记录

旧街凉风 提交于 2019-12-06 03:00:24
一、git讲解: https://www.cnblogs.com/best/p/7474442.html 二、fetch fatal: Refusing to fetch into current branch refs/heads/dev of non-bare repo http://blog.chinaunix.net/uid-20543672-id-3049419.html 三、 reset clear history git init [dir] git clone [url] git status [filename] git add [.][fn1 fn2] git rm --cached <file> 撤销add,从暂存区删除 git reset HEAD <file> 通过重写目录树撤销add文件,工作区也不受影响 git clean [-df] 移除所有未跟踪文件(d包括未被跟踪目录)。d 目录 f强制。删除工作区文件 git rm <file> 暂存区工作区同时删除 rm <file> 未被跟踪,直接删除 git checkout . 暂存区覆盖工作区 git checkout HEAD . 暂存区工作区被HEAD覆盖。暂存区未推送、工作区未提交都丢失 git checkout 汇总显示工作区、暂存区、版本库的差异 git checkout HEAD 同上

svn copy command

北城余情 提交于 2019-12-06 02:36:07
I understand that this a very noob problem, but when I try to create a new branch from already present branch (not trunk) with the command : svn copy svn+ssh://svn.example.com/software/branches/branch_name svn+ssh://svn.example.com/software/branches/new_branch_name -m "Message" I get the following error : svn: No repository found in 'svn+ssh://svn.example.com/software/branches' I have checked again and again, the directory is correct. I don't understand why this is happening. Ahh finally figured out the mistake... the command should have been :- svn copy svn+ssh://user@svn.example.com/software

How can I “splice” two (or more) completely unrelated linear branch ancestries into a new one?

和自甴很熟 提交于 2019-12-06 02:13:00
I'm trying to combine two branches each with different root commit into a new, empty branch. This is not the usual merge thing as i don't want to have the branches combined only in the last commit (in that case, the new branch would have a merge commit and 'below' still two seperate histories. The new branch would still have two root commits.). One important fact in my scenario is that both branches are completely unrelated. None commit of either branch affects pathes of the other branches' commits => There will be no conflicts. Let's assume the following branches: A---B-----C-D X---Y-Z This

How to merge a branch to another branch in GIT?

折月煮酒 提交于 2019-12-06 01:54:03
问题 Let me explain the problem in detail. I have a main git branch on which I created a new side branch bug10101010, now I wan't to merge the bug10101010 to main. So far everything is good. Now I have a different branch of the same product, named legacy. I wan't to merge the bug10101010 to the legacy branch in GIT. Any ideas? I can't just merge it directly, as the branch bug10101010 is spin off from the main branch and in the legacy I need only the diff between the branch bug10101010 and its

how to use nested branches through git-svn

[亡魂溺海] 提交于 2019-12-06 01:29:44
问题 our svn server has a trunk called Dev and Branches live in /Branches/Release/1.0/ /2.0/ /2.3.4/ i cloned it with something like git svn clone -T Dev ... -b Branches ... when I run git branch 2.1 remotes/Release/2.1 i get: fatal: Not a valid object name: 'remotes/Release/2.1'. How do I refer to the remote branch? Do I need to re-clone with different args? 回答1: As mentioned in "How do I import svn branches rooted in different directories into git using git-svn?", you need to grab all the nested

python的零碎知识

做~自己de王妃 提交于 2019-12-06 00:44:52
1.Python代码操作git 安装 pip3 install gitpython 操作git import os from git.repo import Repo # gitpython def clone(): download_path = os.path.join('codes', 'fuck') # git clone -b master https://gitee.com/wupeiqi/xxoo.git # git clone -b v1 https://gitee.com/wupeiqi/xxoo.git Repo.clone_from('https://gitee.com/wupeiqi/xxoo.git', to_path=download_path, branch='master') def pull(): # git pull origin master local_path = os.path.join('codes', 'fuck') repo = Repo(local_path) repo.git.pull() def tag_list(): local_path = os.path.join('codes', 'fuck') repo = Repo(local_path) tag_list = [item.name for item in repo

Git使用记录

泄露秘密 提交于 2019-12-06 00:38:35
一、Git体系概述 Git与SVN的主要区别: 存储方式不一样 使用方式不一样 管理模式不一样 1、存储方式区别 GIT把内容按元数据方式存储类似k/v数据库,而SVN是按文件(新版svn已改成元数据存储)。 git存储过程演示 cd .git/objects/df/ git cat-file -p df70460b4b4aece5915caf5c68d12f560a9fe3e4 echo 'version1' > text.txt git hash-object -w text.txt 2、使用方式区别 从本地把文件推送远程服务,SVN只需要commint 而GIT需要 add、commint、push 三个步骤。 SVN基本使用过程: Git基本使用过程: 3、版本管理模式区别 Git 是一个分布式的版本管理系统,而要SVN是一个远程集中式的管理系统。 集中式: 分布式: 二、Git核心命令使用 主要内容: git客户端安装 git的基本使用 分支管理 标签管理 远程仓库配置 1、git客户端安装 官方客户端: httpsd://git-scm.com/downloads 其它客户端: https://tortoisegit.org/download/ 2、git的基本使用 git项目创建与克隆 文件提交与推送 #基于远程仓库克隆至本地 git clone <remote

git-svn branch - How to keep branch in sync with trunk?

大憨熊 提交于 2019-12-06 00:15:24
There are plenty of questions about git-svn workflow, but I haven't been able to figure this one out: This section of the svn book talks about a common practice with SVN: you make a branch, and you keep merging changes from the trunk as the trunk gets updated, so that the branch always includes the latest changes. I did git svn branch to create a branch on svn and then set up a tracking branch to work on it. These questions cover the process pretty well. Now suppose there were changes made to the trunk, which I now want to merge into the branch. What is my best option? Note that I need to keep

Git: Best way to add only some parts of a file from another branch?

给你一囗甜甜゛ 提交于 2019-12-06 00:13:31
问题 Let's say you have a branch master and another branch production , both containing a version of the file prog.py , as well as many other files. Imagine that you modify many files in the production branch, including prog.py . Now, what is the best way of having only some changes made on prog.py in the production branch be applied to its version in the master branch? I started moving to the master branch and importing the file from the production branch: git checkout master git checkout

git及github使用问题记录(持续更新中...)

╄→尐↘猪︶ㄣ 提交于 2019-12-05 23:41:54
1、从github上pull了一个仓库到本地,修改了若干内容,本地commit之后,再向github上push的时候,提示everything up-to-date。用 git branch 查看本地分支,发现有两个分支: *(no branch) master 于是 git checkout master ,杯具来临了,修改的内容不见了,git log查看不到上次commit的记录。翻箱倒柜的找度娘求助,(不是谷粉:D),问题得以解决: cat .git/logs/HEAD //可以看到提交的结果,同样可以用 git reflog 或 git log -g 命令查看到历史提交记录。 通过 git log -g 查看到所有提交记录,找到你要恢复的 commitid ,即第一行 commit后面的那一大串字符,使用以下命令恢复到recover_branch: git branch recover_branch commitid 再用git branch 即可看到本地有两个branch了: master * recover_branch 参考资料: 从Git仓库中恢复已删除的分支或丢失的commit git常见问题和操作 2、在本地创建tag的方法是 git tag v1.0.0 ,但是这样github上并不能显示你的tag,所以需要输入下列命令以同步tag: git push