branch

How do I list all remote branches in Git 1.7+?

南笙酒味 提交于 2019-11-28 14:54:50
I've tried git branch -r , but that only lists remote branches that I've tracked locally. How do I find the list of those that I haven't? (It doesn't matter to me whether the command lists all remote branches or only those that are untracked.) Dustin For the vast majority [1] of visitors here, the correct and simplest answer to the question "How do I list all remote branches in Git 1.7+?" is: git branch -r For a small minority [1] git branch -r does not work. If git branch -r does not work try: git ls-remote --heads <remote-name> If git branch -r does not work, then maybe as Cascabel says "you

Git 连接github

▼魔方 西西 提交于 2019-11-28 14:41:50
大概如下: 详细如下:如果使用本文命令,请仔细选择,因为添加一些相关命令以供参考。 1 本地仓库 1.1 创建git 仓库 git init # 初始化本地仓库 git --version # 查看Git版本 1.2 配置git 仓库 方法一: git config --global user.name "你的注册用户名" git config --global user.email "你的注册邮箱" 方法二: 直接编辑 vim .git/config "不推荐新手使用" [branch "master"] remote = origin merge = refs/heads/master 1.3 本地使用git 仓库 git clone "分支ssh路径"; git add [*]/git / rm [*]; #提交增加文件和修改文件到缓存区 git commit -m "代码提交信息";#将改动提交到head git sheckout /#切换分支 #删除本地仓库 ls -la #查看.git 文件 rm -rf .git 2.远程仓库 2.1创建远程仓库 若新建远程仓库的时候,点击自动创建了README文件会报错 (解决方法在最后) 2.2 配置秘钥 2.2.1 检查秘钥 cd ~/.ssh # 检查秘钥 2.2.2 生成秘钥 ssh-keygen -t rsa -C

difference between fork and branch on github

☆樱花仙子☆ 提交于 2019-11-28 14:22:19
问题 If I fork a project that's hosted on github. Do I fork all the branches? How do I know which branch my fork is based on? In other words which branch will be downloaded to my PC? 回答1: All branches on GitHub will be copied in a fork. (Obviously, this doesn’t include branches that were never pushed to GitHub in the first place.) But a fork is a GitHub-to-GitHub operation; nothing is copied to your PC. It’s not quite the same as a Git clone . If you mean to ask “what’s copied when I clone a

Gitlab使用和分支管理(三)

情到浓时终转凉″ 提交于 2019-11-28 13:45:22
(一)、配置SSH到Gitlab账号 1、使用ssh-keygen生成密钥文件.ssh/id_rsa.pub [root@zabbix-proxy0496 ~]# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:3DpddsSwRtOfMSDE8NSancZpL9sP7LPKFZQmjc2BWxc root@zabbix-proxy0496 The key's randomart image is: +---[RSA 2048]----+ | .++=+oE.| | ooo@o=.| | .Xo%o+| | . . +.% ..| | S . = + | | o o + o | | o .

How do I move a Git branch out into its own repository?

为君一笑 提交于 2019-11-28 13:12:08
问题 I have a branch that I'd like to move into a separate Git repository, and ideally keep that branch's history in the process. So far I've been looking at git filter-branch , but I can't make out whether it can do what I want to do. How do I extract a Git branch out into its own repository? 回答1: You can simply push a branch to a new repository. All of its history will go with it. You can then choose whether to delete the branch from the original repository. e.g. git push url://to/new/repository

How to correctly close a feature branch in Mercurial?

ぐ巨炮叔叔 提交于 2019-11-28 13:08:32
问题 I've finished working on a feature branch feature-x . I want to merge results back to the default branch and close feature-x in order to get rid of it in the output of hg branches . I came up with the following scenario, but it has some issues: $ hg up default $ hg merge feature-x $ hg ci -m merge $ hg up feature-x $ hg ci -m 'Closed branch feature-x' --close-branch So the feature-x branch (changests 40 - 41 ) is closed, but there is one new head , the closing branch changeset 44 , that will

Git命令大全

拟墨画扇 提交于 2019-11-28 12:27:51
git init 在本地新建一个仓库 repository,进入一个项目目录,执行 git init,会初始化这个仓库,并在当前文件夹下创建一个 .git 文件夹. git clone 获取一个url对应的远程Git repo, 创建一个local copy. 一般的格式是git clone [url]. clone下来的repo会以url最后一个斜线后面的名称命名,创建一个文件夹,如果想要指定特定的名称,可以git clone [url] newname指定. git status 查询repo的状态. git status -s: -s表示short, -s的输出标记会有两列,第一列是对staging区域而言,第二列是对working目录而言. git log show commit history of a branch. git log --oneline --number: 每条log只显示一行,显示number条. git log --oneline --graph:可以图形化地表示出分支合并历史. git log branchname可以显示特定分支的log. git log --oneline branch1 ^branch2,可以查看在分支1,却不在分支2中的提交.^表示排除这个分支(Window下可能要给^branch2加上引号). git log -

Git常用命令

ⅰ亾dé卋堺 提交于 2019-11-28 12:27:31
转自: https://cloud.tencent.com/developer/article/1356476 一、Git工作流程 以上包括一些简单而常用的命令,但是先不关心这些,先来了解下面这4个专有名词。 Workspace:工作区 Index / Stage:暂存区 Repository:仓库区(或本地仓库) Remote:远程仓库 工作区 程序员进行开发改动的地方,是你当前看到的,也是最新的。 平常我们开发就是拷贝远程仓库中的一个分支,基于该分支进行开发。在开发过程中就是对工作区的操作。 暂存区 .git目录下的index文件, 暂存区会记录 git add 添加文件的相关信息(文件名、大小、timestamp...),不保存文件实体, 通过id指向每个文件实体。可以使用 git status 查看暂存区的状态。暂存区标记了你当前工作区中,哪些内容是被git管理的。 当你完成某个需求或功能后需要提交到远程仓库,那么第一步就是通过 git add 先提交到暂存区,被git管理。 本地仓库 保存了对象被提交 过的各个版本,比起工作区和暂存区的内容,它要更旧一些。 git commit 后同步index的目录树到本地仓库,方便从下一步通过 git push 同步本地仓库与远程仓库的同步。 远程仓库 远程仓库的内容可能被分布在多个地点的处于协作关系的本地仓库修改

What is the equivalent of branch reset operator (“?|”) found in php(pcre) in C#?

Deadly 提交于 2019-11-28 11:13:05
The following regular expression will match "Saturday" or "Sunday" : (?:(Sat)ur|(Sun))day But in one case backreference 1 is filled while backreference 2 is empty and in the other case vice-versa. PHP (pcre) provides a nice operator "?|" that circumvents this problem. The previous regex would become (?|(Sat)ur|(Sun))day . So there will not be empty backreferences. Is there an equivalent in C# or some workaround ? .NET doesn't support the branch-reset operator, but it does support named groups, and it lets you reuse group names without restriction (something no other flavor does, AFAIK). So you

Middle-ground between submodules and branches?

自作多情 提交于 2019-11-28 10:57:13
问题 I just got around creating topic branches for my project's unfinished features, managed by Git. They are all very self-contained in such a way, that one topic branch doesn't directly relate to another topic branch. All branches, however, have some common ground, the master branch, which is the core of the system, the topic branches just extend the features in the master branch. If I've understood correctly, if I do something in the master branch that affects (m)any topic branches (say, change