branch

Git 基本使用及工作流程详解

♀尐吖头ヾ 提交于 2019-12-01 22:09:30
一、Git 用户信息配置 # 设置全局用户名和邮箱 $ git config --global user.name "xxx" $ git config --global user.email "xxx@xxx.com" 二、从远程仓库获取目录 # 在已经有远程仓库的情况下使用,比如新入职一家公司 ## 进入一个文件夹,用于放置clone下来的代码 $ cd test ## 把远程仓库代码clone下来 $ git clone https://github.com/xxxx/xxxx.git $ cd git_demo ##查看状态 $ git status ## 默认远程仓库名为origin On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean 三、修改和增加代码并推送 ## 添加所有修改的文件,也可以git add xx.txt 指定某个文件 $ git add . ## 提交修改 $ git commit -m "update" ## 推送到远程仓库 $ git push 四、分支 # 一般情况下,当我们需要添加一个新功能的时候,是不能在主分支上直接修改的,这时,需要创建一个新的分支,等功能开发并测试完成之后

Recreate Git Ref after Fatal Error

浪尽此生 提交于 2019-12-01 19:18:13
I recently had to perform a hard reboot and I am now receiving an error in git when I try to access a specific branch (this does not happen when accessing other branches): $git checkout branchName fatal: failed to read object ebca165c3ec7ecd7124f41983dd264e4e1dc0125: Invalid argument The problem is similar to the one described here: How to restore a corrupted git repository? , but differs in the fact that I am not currently on that branch to perform git status . Also, if I call git reflog I receive the same error message. I tried to delete the branch in question using git branch -d branchName

linux svn恢复删除的文件夹和文件

笑着哭i 提交于 2019-12-01 18:54:22
我觉得在window下面,查找被删除的svn文件夹和文件是件比较麻烦的事,恢复就更麻烦了。有的时候,命令还是比鼠标要好用的。 下面做一个例子来说明一下,删除和恢复的例子。 查看 复制 打印 ? [root@BlackGhost branch]# svn delete tank //标记删除一个目录,不是真正删除 D tank [root@BlackGhost branch]# svn revert tank //可以用svn revert dir 来恢复前面的操作 Reverted 'tank' [root@BlackGhost branch]# svn commit tank -m "tank" svn: Working copy '/home/zhangy/checkout/repos' locked svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) [root@BlackGhost branch]# svn cleanup //如果出现锁定的情况,cleanup一下 [root@BlackGhost branch]# svn ci tank -m "tank" Deleting tank Committed revision 21. [root@BlackGhost

TFS 2010 - command line for convert to branch

烂漫一生 提交于 2019-12-01 18:20:43
TFS exposes a commmand line utility which covers most of the areas. However I am creating a script which will create the folder and branch structure within a specified project. For this i need to convert my Truck to a branch and then further create branches from there. I cannot find the command which does this. So far I have found this link which desribes to to convert a folder to a brnch, but has no reference to the command line utility unlike the other descriptions. Does that mean that the command line utility does not support this? Ewald Hofman The question is answered in more detail on the

TFS 2010 - command line for convert to branch

大城市里の小女人 提交于 2019-12-01 17:56:01
问题 TFS exposes a commmand line utility which covers most of the areas. However I am creating a script which will create the folder and branch structure within a specified project. For this i need to convert my Truck to a branch and then further create branches from there. I cannot find the command which does this. So far I have found this link which desribes to to convert a folder to a brnch, but has no reference to the command line utility unlike the other descriptions. Does that mean that the

SVN branch of a branch

萝らか妹 提交于 2019-12-01 17:28:12
Our code repository includes: * trunk, * branch A - starts from trunk, * branch B - starts from branch A, The programer that works on branch A wants to reintegrate it into the trunk, and continue working on the trunk only. We do not want to reintegrate branch B into branch A yet. Is it possible to have branch B relate to the trunk, instead of to branch A, so that the two programmers can continue to work separately on trunk and on branch B? (I hope my question is clear) altern As I see it, you have following situation: And you are going to do merge from A to trunk : As you see, B has started

Workflow to “backport” change into different Mercurial (Hg) branch?

浪尽此生 提交于 2019-12-01 16:16:59
We have two heads. One is our main development head and the other is one that I forgot about until today. We found a bug and fixed it in our main development branch, and I just realized it should be fixed in the older branch as well. I think it would have been better to make the change on the older branch and merge that with the up-to-date branch, but we didn't do it that way. Can mercurial handle this? We haven't tried to do anything like this and I can't really wrap my head around how it would be done. Martin Geisler Yes, you have two good options: Graft: new in Mercurial 2.0 This version

git常用命令

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 15:44:28
//查看本地分支 git branch //删除目标分支 git branch -D master git branch -D service_shop //重新拉取master分支 git checkout master git checkout service_shop //创建新的分支 git checkout -b service_shop //上传文件流大哪个分支 git push --set-upstream origin service_shop //查看本地分支 git branch //删除目标分支 git branch -D master git branch -D service_shop //重新拉取master分支 git checkout master git checkout service_shop //创建新的分支 git checkout -b service_shop //上传文件流大哪个分支 git push --set-upstream origin service_shop 来源: https://www.cnblogs.com/qianjinyan/p/11691290.html

SVN branch of a branch

蹲街弑〆低调 提交于 2019-12-01 15:27:04
问题 Our code repository includes: * trunk, * branch A - starts from trunk, * branch B - starts from branch A, The programer that works on branch A wants to reintegrate it into the trunk, and continue working on the trunk only. We do not want to reintegrate branch B into branch A yet. Is it possible to have branch B relate to the trunk, instead of to branch A, so that the two programmers can continue to work separately on trunk and on branch B? (I hope my question is clear) 回答1: As I see it, you

git远程分支

血红的双手。 提交于 2019-12-01 15:24:22
git clone 命令可以将远程仓库拷贝到本地。下面的命令默认只将master分支拷贝到本地,在当前目录创建一个learngit目录,然后再在讲远程git仓库的内容都拷贝到这个目录下,并创建一个隐藏的/.git目录,自动配置远程仓库名称为origin,将最新版本的仓库内容拷贝到当前工作区。 git clone git@github.com:Richard-coder/learngit.git 如果执行下面命令,git clone 后自动创建的目录为mylearn git clone git@github.com:Richard-coder/learngit.git mylearn 克隆版远程仓库的时候,所使用的远程主机自动被Git命名为origin。如果想用其他的主机名,需要用 git clone 命令的-o选项指定。 git clone -o myremote git@github.com:Richard-coder/learngit.git 执行下面命令查看本地分支和远程分支 git branch -a #本地+远程 git branch -r #远程 git branch #本地 执行下面命令查看远程的dev分支,切换后的分支叫做远程跟踪分支,是远程分支origin/dev的引用,但是不能在本地移动。 git checkout origin/dev 但是