git-branch

GitHub: What is a “wip” branch?

◇◆丶佛笑我妖孽 提交于 2019-11-30 00:12:32
When I was browsing GitHub repositories I quite often saw "wip" branches (e.g. 3.1.0-wip ). What does "wip" mean? I couldn't find the answer anywhere - neither on Google nor on GitHub:help. Conventionally, "wip" stands for "work in progress". On GitHub, pull requests are prefixed by [WIP] to indicate that the pull requestor has not yet finished his work on the code (thus, w ork i n p rogress), but looks for have some initial feedback ( early-pull strategy ), and wants to use the continuous integration infrastructure of the project. For instance, TravisCI , CodeCov , and codacy . More

Where did I branch from?

六月ゝ 毕业季﹏ 提交于 2019-11-30 00:06:31
问题 I got back on an old project and I ran the nice git status to figure out what was going on and I noticed way too many branches! I want to do some housekeeping before starting to work on this again but I'm not sure which branch comes from which.. E.G. Does "branchA" derive from "develop"? Does "branchB" derive from "master" or "branchA"?? How can I answer the sample questions above? 回答1: There's no canonical answer for this, since branches are simply pointers to certain commits in a DAG. For

How can I completely empty the master branch in Git?

余生颓废 提交于 2019-11-29 22:06:17
I would like to completely empty the master branch in Git. For now, I would also like to keep all other branches which have been branched from master. Is this possible and how? That's actually called "delete old master branch and create new from scratch" This will create a new master branch pointing to initial commit: git branch -D master git checkout -b master <initial commit hash> This will create a totally new master branch unrelated to whatever you had: git branch -D master git checkout --orphan master git rm -rf * But actually you can simply save current repository to some other place and

How do I shallow clone a repo on a specific branch?

一个人想着一个人 提交于 2019-11-29 22:02:17
How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch? I know how to do a shallow clone: git clone --depth 1 https://path/to/myrepo.git but not start the clone on a specific branch. joseph.hainline To clone repo foo.git with branch bar do: git clone --depth 1 https://path/to/repo/foo.git -b bar See the git-clone documentation: https://www.kernel.org/pub/software/scm/git/docs/git-clone.html 来源: https://stackoverflow.com/questions/21833870/how-do-i-shallow-clone-a-repo-on-a-specific-branch

how does exactly a git merge conflict happen?

做~自己de王妃 提交于 2019-11-29 21:24:11
I have made a git repository and added a text file to it. This is 100% for learning purpose. I added "1" to the text file and committed it to master. Created a new branch from master and appended "2". Finally, created a branch from master and appended "3". Could you please explain how a conflict may occur in this, or any other, scenario? VonC You will have a conflict if you merge: branch2 to master (no conflict) branch3 to master (conflict): That is because: The common ancestor would be master (with a second line empty) the source content is branch3 (with a second line including "3") the

git checkout --ours does not remove files from unmerged files list

喜夏-厌秋 提交于 2019-11-29 20:29:09
Hi I need to merge two branches like this. This is just an example what is happening, I work with hundreds of files which need resolution. git merge branch1 ...conflicts... git status .... # Unmerged paths: # (use "git add/rm <file>..." as appropriate to mark resolution) # # both added: file1 # both added: file2 # both added: file3 # both added: file4 git checkout --ours file1 git chechout --theirs file2 git checkout --ours file3 git chechout --theirs file4 git commit -a -m "this should work" U file1 fatal: 'commit' is not possible because you have unmerged files. Please, fix them up in the

Git create branch where detached HEAD is [duplicate]

半城伤御伤魂 提交于 2019-11-29 20:22:38
This question already has an answer here: git: switch branch without detaching head 4 answers I tried something like this: git branch temp to create a new branch but don't move the HEAD . But I get: # Not currently on any branch. I don't want to merge anything, I just want a new branch at the current HEAD . You're sitting on a detached HEAD : git checkout <sha> You want to make a branch at that commit: git branch my-new-branch And now switch to that branch: git checkout my-new-branch 来源: https://stackoverflow.com/questions/22366034/git-create-branch-where-detached-head-is

How to use git branch with Android Studio

99封情书 提交于 2019-11-29 20:09:24
I am new to git. I have a very simple scenario for using git. I had my first release written with Android Studio. Now I want to work with some new features. What I did so far: enabled the VCS in my Android Studio created a local repository for my project from Android Studio pushed my local repository to my Bitbucket remote repository ( $git push -u origin master ) Now I am confused for the next step: create a feature branch. Should I create a branch in the local repository: $ git branch --track feature1 origin/master or should I create a new branch from the Bitbucket web portal, and clone the

Can I delete all the local branches except the current one?

戏子无情 提交于 2019-11-29 19:56:13
I want to delete all branches that get listed in the output of ... $ git branch ... but keeping current branch, in one step . Is that possible? If so, how? Vadorequest Based on @pankijs answer, I made two git aliases: [alias] # Delete all local branches but master and the current one, only if they are fully merged with master. br-delete-useless = "!f(){\ git branch | grep -v "master" | grep -v ^* | xargs git branch -d;\ }; f" # Delete all local branches but master and the current one. br-delete-useless-force = "!f(){\ git branch | grep -v "master" | grep -v ^* | xargs git branch -D;\ }; f" To

Track a new remote branch created on GitHub

旧城冷巷雨未停 提交于 2019-11-29 19:03:28
I have already got a local master branch tracking the remote master branch of a github project. Now, a collaborator of mine has created a new branch in the same project, and I want to do the following accordingly: create a new branch locally make this new branch track the newly create remote branch. How should I do it properly? git fetch git branch --track branch-name origin/branch-name First command makes sure you have remote branch in local repository. Second command creates local branch which tracks remote branch. It assumes that your remote name is origin and branch name is branch-name . -