branch

git在idea中使用

不打扰是莪最后的温柔 提交于 2019-12-08 16:58:29
(1)创建README.md文件 fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master) $ touch README.md (2)创建.gitignore文件(用于忽略上传的文件) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #提交到码云上面忽略的东西配置 *.class #package file *.war *.ear *.orig target/ .settings/ .project .classpath .idea/ /idea/ *.ipr *.iml *.iws *.log *.cache *. diff *.patch *.tmp .DS_Store Thumbs.db    fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master) $ touch .gitignore (3)初始化git fengli@DESKTOP-FEQ1N4I MINGW32 /f/workspace/imallproject (master) $ git init Initialized empty Git repository in F:

How to git clone an SVN repository where all branches are located in root?

落花浮王杯 提交于 2019-12-08 16:13:36
My SVN structure is like this: / |-- Branch1 |-- Branch2 |-- Branch3 ... How can I clone this into a git repository preserving the branches (i.e. not flat history)? Bonus question: How to clone only a subset of the SVN branches into a new git repository? I believe that in SVN branches are just folders, its just a convention. Git actually works with branches. With this the approach becomes easier. As you need to fetch the data from SVN repository you will need to create remote for it. From the structure I see that you need to create Branch 1 to 3 in your git repository. Create Git repository.

Why does `git checkout <branch> <file>` stage the change?

蓝咒 提交于 2019-12-08 15:26:53
问题 If I start from a clean working tree and run git checkout <branch> <file> , where <branch> has a different version of this file, I end up with a staged rather than an unstaged change. What's the reason for this? Is this just for consistency with other commands like git mv , which you would expect to stage changes? Is it for convenience when using git checkout to resolve merge conflicts? Or is there some other rationale? It seems mildly odd to me since just using git checkout <branch> <file>

Cannot open FETCH_HEAD after renaming a branch

早过忘川 提交于 2019-12-08 14:14:19
After having renaming the 'master' branch (using Sourcetree), I can't fetch anymore the changes done in the remote repository. I get the error: error: cannot open .git/FETCH_HEAD: Permission denied When I open this file, I see that the referenced branch is still set toward branch 'master' . Taking a look at the remote repository, I saw that a branch with named 'master' still exists, in addition to the renamed branch where I merged my last changes. I think there have got a problem somewhere and the renaming was not replicated correctly in the remote repository. I have tried to manually edit the

Unable to push commits

做~自己de王妃 提交于 2019-12-08 14:08:55
问题 I am trying push a recent commit to my central repository on github, but I am denied access to my own repository. What can I do to change or override settings? frameworks/Semantic-UI$ sudo git push Username for 'https://github.com': team@everest.software Password for 'https://team@everest.software@github.com': remote: Permission to Semantic-Org/Semantic-UI.git denied to everest-software. fatal: unable to access 'https://github.com/Semantic-Org/Semantic-UI.git/': The requested URL returned

Creating a branch with TortoiseSVN without /trunk structure

和自甴很熟 提交于 2019-12-08 12:43:28
问题 Background: We have our source code saved in an SVN repository at our own server. We have Team A working on the main functionality of the website. We are looking to work with a Team B on the design aspects which will be at a different location. A long time back when setting up the SVN repository, I created it with a structure which was finally accessible at: svn://www.myserver.com/main/abc The source code files are present at the 'abc' level and in folders below that. This has been working

How can I restore a local branch after deleting it?

霸气de小男生 提交于 2019-12-08 09:56:43
问题 I had a branch called my_branch_1 in my local repository, which I deleted. my_branch_1 was only local; I never pushed it to a remote server. Is it possible to restore this branch, somehow? 回答1: Yes, you can see its SHA1 with git reflog. Then you can re-create it: git checkout -b my_branch_1 SHA1 You can also have a look at the script (included in a Git distrib): contrib/git-resurrect.sh . 回答2: VonC has guided you in the correct direction. But I could not able to stop myself from sharing this

How to delete a clearcase branch with a single command?

若如初见. 提交于 2019-12-08 07:40:58
问题 I've accidentally created a branch with the wrong config spec and I've made a merge in there that wasn't meant to be done. Is there a way to remove this branch like it never existed, with one and only command? There are no checked-out files in the branch. I could go through all files and do it manually since there are only 3 files that were merged. But what if there were 3000 instead of 3? 回答1: You can try and delete the byrtpe (branch type) with cleartool rmtype brtype:xxx. That is possible

how to keep git submodule on-branch status after cloning superproject?

匆匆过客 提交于 2019-12-08 07:28:55
问题 I am testing the new git submodule add -b feature (after git 1.8.2), which creates sub-module that allegedly tracks a branch rather than a commit. I am using git version 1.8.4.msysgit.0 . The branch-tracking feature for submodules seems to work fine in the original super-project but fails as soon as the super-project is cloned. To be more specific: What I did is typical, and is roughly as follows, 1. create a git repo (called common): ... 2. create a main project (called main), which uses

Deleting/“Rebasing” rails migrations

人走茶凉 提交于 2019-12-08 07:20:50
问题 I've been working in a git branch on one portion of a rails site. I've made a lot of random changes to the schema while iterating, and I've made some migrations that revert previous migrations to add columns and things like that. Is it OK to delete redundant migrations like those (i.e. pairs of migrations that are just reverses of each other)? I don't see why it would cause any problems because no one else is working on this branch, and the end result will be the same. Is there any chance of