Webstorm: How to clone git repo into existing project folder? - version-control

Webstorm 10.0.4
I create new project:
I create new folder "myProject"
I try to clone git repo to that folder
At the moment when I do: menu > VCS > Checkout from Version Controle > Git
... I see:
BUT:
I don't want to clone project into subfolder. I want to clone it to "myProject" folder root!
How can I do that (via GUI)?

Related

How to deploy a project on GitHub Pages from dist folder

I have built my project with parcel and it gave me all my files in dist folder and I push it to a repo on GitHub. now I have dist folder and also src folder ( which was for develop phase). How can I deploy the page from dist folder using git ( on Github site I only know how to deploy from main branch not from another folder).
here is the repo address:
click to go to repo
Rename your dist folder as docs on your local repository, git add, commit and push. After that open your repo, go to Settings > Pages, leave the source dropdown on "Deploy from a branch", on branch dropdown select your main branch and select the docs folder, and you are ready to go.

EGit Issue in IIB10 Toolkit

I've GitHub repository in my IIB10 toolkit using EGit plugin.
I used to work with that repository.
I took workspace project interchange(PI) backup, later some changes my project has crashed.
So, I just imported my project from the PI backup and it got disconnected from GitHub.
I am using the same project in the different workspace, there also this project has deleted.
Now I have that project in the local workspace(not local git). How can I resolve this one? Please help me out.
If your workspace has no .git subfolder, you should at least:
clone your original GitHub repository
import your restored backup back to the new local clone
That is:
cd /path/to/restored/repo
cd ..
git clone https://github.com/<me>/<myrepo>
cd myrepo
git --work-tree=../repo add .
git commit -m "import from backup"
git push

How to import a specific project from github

How to import a specific project from github ? I dont want to clone the entire repository
I just want to clone only a portion of repository .
For eg this url https://github.com/eugenp/tutorials
has many projects but I just want to clone only spring-boot-crud project .
Here is the url for spring-boot-crud project.
https://github.com/eugenp/tutorials/tree/master/spring-boot-modules/spring-boot-crud
Thank you .
You can look into a git sparse-checkout: that command is made to checkout only part of a Git repository. This assume the latest Git 2.26 though.
And I mean Git-core, as in Git SCM, not Egit (which does not support the new sparse-checkout command)
Even though the command is new and still experimental, it should be useful in your case.
git clone --no-checkout /url/a/repo
cd repo
git sparse-checkout init --cone
git sparse-checkout set spring-boot-modules/spring-boot-crud
Then open the relevant project in your Eclipse.
Create a project in the Git repo (.project, in the root folder of your repo)
That will give you:
git clone -n https://github/git/git git2
cd git2
git sparse-checkout init
git sparse-checkout set Documentation
At this point, you have the repository git/git with only the folder Documentation checked out (everything else is not in the working tree)
# create an empty project in C:\path\to\git2 in Eclipse
As you can see, all the other files not checked out are not displayed in the Git staging view. Only the ones currently checked out and modified are listed.
The first step must be done in command-line because JGit does not support the sparse-checkout directive (see but 383772 and change 33)

Github - How to commit my project to a sub-folder / directory of a existing repository?

In Github, i have already a repository, e.g. called "java8"
And under it, i would like to have a sub-folder, e.g. called "01-lambda"
So my folder structure in github should be
java8
01-lambda
02-enums
etc.
Then I want to commit my code to the sub-folder "01-lambda"
How can I do that?
What I tried:
I just created a new folder with a txt file "01-lambda" under the repository "java8", then I tried to commit, but git bash shows they cannot find the sub-file.
I just commit my code directly to repository "java8", but then I need to change path of every files, and add /01-lambda in the path
git init
git add *
git commit -m “my first repo”
git remote add github .git
git remote -v
git push -f github master
I just created a new folder with a txt file "01-lambda" under the repository "java8", then i tried to commit, but git bash shows they cannot find the sub-file.
You need to add before committing, assuming you do have a file inside the new folder (Git would not add just a folder):
git add 01-lambda
git commit -m "add 01-lambda"

Cloning a git repo that has submodules

I have a git repot that has a submodule.
I want to clone this repo into an eclipse workspace, I've read this
Working with Submodules
You can read more about what Git submodules are and how they work in this Git Community Book chapter.
Cloning Repositories with Submodules
Submodules are repositories nested inside a parent repository.
Therefore when doing a clone of a parent repository it is necessary to
clone the submodule repositories so that the files/folders are
available in the parent repository's working directory.
Checking the Clone Submodules button from the Git Clone wizard will clone all submodule repositories after the clone of the parent
repository finishes.
However, when I am done cloning, the submodule directory is empty
and the project doesnt appear in the workspace.
How do I add the submodule ?
in eclipse go to git explorer perspective
you can import you project modules under you project
project> working directory > select sub module > import project.
>> Import as general project (for new)
>> Import existing project (which will replace you current project)
if you have 3 modules you need to import one by one. as existing module or new one
git clone yourProjectUrl.
in your project folder: git submodule init (only do it first time)
you can also update submodule: git submodule update.