branch

Orphaned Branches in TFS

霸气de小男生 提交于 2019-12-04 01:49:10
We have a trunk in TFS that everyone works off until we have a need to branch. Our last project was a large feature that required a branch. Now that the development has been completed and the changes have been merged back into the trunk. What should happen to the development branch? Should I delete it? Mark it as read-only somehow? What about cloaking and locking? You can make a branch read-only. You just need to remove the check-in/check-out permissions from the appropriate groups. Note that it doesn't look any different on first blush, but when you attempt to check out a file, you'll be

git fetch origin doesn't fetch all branches

淺唱寂寞╮ 提交于 2019-12-04 00:40:25
I read in the answers to this question that git fetch origin should fetch all branches of origin. In my case, it doesn't seem to give me any branches, though. Here's what I did: Initially, a remote called origin had 7 branches. I cloned it. git branch then returned only master . I did git fetch origin , and git branch still only shows master . How can I get the other 6 branches without fetching them individually? You have all 7 branches, but git branch only shows local branches. Even though you now have the branch data locally on your system, they are still considered "remote branches". You

“Naive” svn merge from branch into trunk?

*爱你&永不变心* 提交于 2019-12-03 23:54:12
I am using TortoiseSVN for my C++ project, and am trying to "reintegrate a branch" back into the trunk. My case is simple enough so that for every file which has changed in the branch, I would like it to completely overwrite the matching file in the trunk. Unfortunately, TortoiseSVN is smarter than me, so it merges each pair of files - resulting in some inconsistent code. For example, some code lines which have been deleted in the branch are restored in the merged version. Is there any way to force TortoiseSVN to use the naive merge behaviour of overwriting all the modified files? Thanks, Dan

Create branch from current working tree and reset to HEAD

放肆的年华 提交于 2019-12-03 23:53:16
I currently work on a feature that turns out to be bigger than expected, so it's propably the best to create a branch to work on it. So I need to create a new branch from my current working directory and reset the master branch to the current HEAD so that some fixes to the production environment can be done. Somehow this sounds like an easy task, yet I can't quite figure it out. Possibly due to my lack of sleep. So, create a working branch: git checkout -b working_branch either commit or stash your changes git add <files> git commit -m "message" OR git stash Go back to master git checkout

git新建与合并

六月ゝ 毕业季﹏ 提交于 2019-12-03 23:44:12
先看一下git的命令:1.查看本地分支 git branch ;查看远程分支 git branch -r ;切换分支 git checkout -b agrochemical origin/agrochemical;查看所属分支 git branch -a;回退命令: $ git reset --hard HEAD^;回退到上个版本 $ git reset --hard HEAD~3;回退到前3次提交之前,以此类推,;回退到n次提交之前 $ git reset --hard commit_id;退到/进到 指定commit的sha码 $ git checkout commit ID;查看提交记录:$ git log;强推到远程:$ git push origin HEAD --force 2.git之删除远程仓库文件,使用 git rm 命令即可,有两种选择:一种是 git rm --cached "文件路径",不删除物理文件,仅将该文件从缓存中删除;一种是 git rm --f "文件路径",不仅将该文件从缓存中删除,还会将物理文件删除(不会回收到垃圾桶)。假如你有文件不小心commit到了服务器那么你想要删除它,可以使用:git rm -- cached "路径+文件名" ;git commit -m "delete file" ;git push;git rm -r "路径

How to run git commands on remote without having local repo

女生的网名这么多〃 提交于 2019-12-03 23:21:20
I have a script called 'git-export' which helps me to export a remote repository. It is run like that: git-export http://host.com/git-repo <-t tag or -b branch or -c commit> /local/dir Before it was used to export local repository and I used these commands: to get commit from branch: git branch -v --no-abbrev|awk '($1=="'$BRANCH'") || ($1 == "*" && $2 == "'$BRANCH'"){if($1 == "*"){print $3;}else{print $2;}}' or git rev-parse -q --verify $BRANCH^{commit} to get commit by tag: git rev-parse -q --verify $TAG^{commit} also I have scripts to list tags, versions (tags, starting with v), I use git

How do I safely delete a remote git branch?

邮差的信 提交于 2019-12-03 23:20:54
To delete a local branch in git I use git branch -d , but how do I safely remove a remote branch? I would like to delete it only when the remote branch is merged to my current branch . eckes The answer is partly covered here: How can I know in git if a branch has been already merged into master? While that post copes with local branches, you could find remote branches that are merged or not using git branch -r --merged to detect all remote branches that are already merged into the current git branch -r --unmerged to do the opposite git branch -r --no-merged is correct for the new version of

Use GIT fork / branches

不问归期 提交于 2019-12-03 22:27:20
问题 I am using Git for a while but i still have trouble understanding some features despite hours spent on blogs and tutorials... :) I am working on a project with other people for which my boss created a repo on bitBucket. I cloned it locally, and already did some commits to the master branch, and pulled some changes by others. I now want to do modifications on the long term. I will have to push some of them to the master branch, and keep other ones just for myself. I think that i could fork the

How to create a new source code branch using TFS API?

强颜欢笑 提交于 2019-12-03 21:59:09
问题 I am trying to create a new branch using the API, and have used both PendBranch() and CreateBranch() . The problem with CreateBranch() is it commits immediately and I want to be able to add comments as the branch is checked in. So, I what I did is shown below. Basically I get all the information like server item and local item to be mapped as well as source and target of the branch from my windows application. Somehow, when I see Source Control Explorer it still says "Not mapped" even though

How to merge bug fix branch into trunk and release branch

耗尽温柔 提交于 2019-12-03 21:49:31
Consider the following situation: Development is mainly done in trunk. Branches are used when fixing complex bugs or developing new (unstable at first) features. Normally these branches are then merged into trunk once development is done. 1 branch is used as current release branch (say currently "R-1.0"). Tags are used for the release (would be "R-1.0.0"). Now a complex bug which is in trunk as well as in the current release 1.0.0 must be fixed: A branch "BG-1" from trunk will be created. The bug will be fixed in this branch. At the same time development will continue in the trunk. How do you