branch

Mercurial branching and bookmarks

吃可爱长大的小学妹 提交于 2019-12-02 16:29:09
I read some information about named branches and working with bookmarks. Unfortunately I still don't see a difference between them. Is there any? Is there any difference between: hg branch blah hg up blah and hg bookmark blah hg up blah ? Why would I use a bookmark and how is it different from a named branch? Ry4an Brase Bookmarks are tags that move forward automatically to subsequent changes, leaving no mark on the changesets that previously had that bookmark pointing toward them. Named branches, on the other hand, are indelible marks that are part of a changeset. Multiple heads can be on the

git 常用命令的总结

一世执手 提交于 2019-12-02 16:24:15
1、 git 查看分支 git branch (星号代表当前的分支) 2、 创建一个本地分支 git checkout -b 分支名称 3、 将本地新建分支提交到远程 git push origin 分支名称:分支名称 4、 删除远程分支 git push origin :分支名称 5、 删除本地分支 git branch -d 分支名称 // 强制删除分支 git branch -D 分支名称 6、 切换分支 git checkout 分支名称 7、 如果本地有多个分支,指定本地分支追踪远程的哪个分支 // 设置本地分支 local_branch 追踪远程分支 origin/<branch> git branch --set-upstream-to=origin/<branch> local_branch // 本地 master 追踪远程 master git branch --set-upstream-to=origin/master master 8、 更新本地仓库 git pull 9、 查看本地修改 git status 参考文献: https://blog.csdn.net/weixin_34239592/article/details/91423705 https://blog.csdn.net/bjzhaoxiao/article/details/95595758

Untracked files between branches in Git

谁说胖子不能爱 提交于 2019-12-02 15:49:05
I've been searching around here for to look for an answer and it seems I may just be making incorrect assumptions on how git branches are supposed to work. I have my master branch and I've created a feature branch called profiles where I'm doing some specific work to profiles. While working on profiles I've changed 5 or 6 files and added another 5 or 6 new files. I needed to switch back to the master branch to fix a quick bug and noticed all the new files and modified files where in there as well. I guess this makes sense since git isnt going to remove untracked files from the master branch

Git branch deletion

巧了我就是萌 提交于 2019-12-02 15:39:24
In Git, what does "deletion" of a branch mean? Will it be gone from the repository? Or will it still be navigable to via git branch ? What I really want to do is mark a branch as "dead end", i.e., the branch is so far from master, that nobody should use it as a starting point, though there were some good ideas down that branch, so we'd like to keep it, for reference. You can delete the branch, but tag it first, so that it's history doesn't disappear. This way, the branch doesn't show up in the branch list, which should hopefully deter people from working on it, but the work won't be

Svn switch from trunk to branch

余生长醉 提交于 2019-12-02 15:21:53
I am in the root folder of an SVN-hosted project's trunk and am exploring setting up two branches. One branch will be a "snapshot" of the project at the current (stable) revision, and a second branch will be one I'll work on to apply some new code, test, and then upgrade the trunk to a new version. My goal is to keep the snapshot as insurance and a quick way to get an older, stable version of our project. The second branch, once we apply fresh code and the tests pass, will be merged back into the trunk, which we offer to the public. To set up the snapshot, I copied our trunk to a branch called

Fork from a branch in github

余生长醉 提交于 2019-12-02 15:10:44
Is there a way to fork from a specific branch on GitHub? … For example, moodle has many branches (1.9, 2.0 … and so on). Can a clone be performed of just branch 1.9 and not the master branch always? Is it possible to clone a specific branch onto my PC? I don’t know a native way yet, but you can do it following this recipe: Fork the repository in question (called ‘upstream’) on the GitHub website to your workspace there. Run the GitHub desktop application and clone the repository onto your PC. Use the GitHub desktop application to open a shell in the repository. (The git commands are not

Switch to another branch without changing the workspace files

一世执手 提交于 2019-12-02 14:49:12
I cloned a git repository from GitHub, made some changes and some commits; I made quite a lot and all are quite dirty, so they're not suitable for a pull request. Now I created the branch cleanchanges from origin/master , so it's clean, and I want to commit my changes there as one commit with a nice commit comment. When I am on the local master, I want to switch to my cleanchanges but without changing the files. And then I'm able to commit. How can I switch branches without changing files? I want to make it clear: I have all the changes committed in the local master . There are no uncommitted

Git: how to maintain permanent parallel branches

放肆的年华 提交于 2019-12-02 14:42:25
We have project (PHP application), but instalation for each client vary, sometimes very little, sometimes more. Still, big part of source code is common. We manage specific installations as parallel branches to master branch and we need to transfer changes from master to other branches. Same situation was solved in Git: how maintain (mostly) parallel branches with only a few difference? The most voted solution was to transfer changes between braches this way: git pull git checkout local git rebase master As mentioned in the solution it creates non-fast-forward pushes after rebasing which I

How to only push to one branch in Hg?

萝らか妹 提交于 2019-12-02 14:27:22
I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). hg heads shows 3 heads, one for each branch, even though hg branches shows 2 of those branches as 'inactive'. When I try to push my default branch (using hg push --branch default http://... ) to another repo, the merge is aborted with the message "abort: push creates new remote branches: !" From the Hg push man pages, "By default, push will not allow creation of new heads at the destination, since multiple heads would make it unclear which head to use. In this

Git commit against tag with no branch

末鹿安然 提交于 2019-12-02 14:21:48
If I check out a tagged version of my source code without creating a branch, Git indicates that I'm not associated with any branch at all. It's happy to let me make changes and check them in though. Where do those changes go? If I switch back to 'master' they disappear (overwritten by what was in master) and I can't seem to find them again. What gives? If Git lets me commit changes against what's essentially an anonymous branch, surely I can get them back? Paul Because your commit isn't on any branch , you can't see it in the working directory unless you checkout that specific commit, using