Today I use "jhipster upgrade" to my application (in a new branch, and the jhipster version is v5.8.2, npm and yarn also latest version), and get a lot of conflict, then I use two below git commands to quit the merge conflict:
git checkout -- .
git merge abort
Then I delete the branch and create it again, when I run "jhipster upgrade" again, the upgrade progress go on, looks like a lot of things upgraded as before, but when I check with "git status", nothing changed.
I checked the upgrade screen and found a fatal message as:
....
Merging changes back to upgrade01...
info git merge -q jhipster_upgrade
fatal: refusing to merge unrelated histories
....
Anyone konw what prevent the upgrade progress? How can I upgrade again?
Related
Background
I have a project that's split into several smaller projects with one main project that downloads the others as dependencies of the main project.
I'm using Gitlab to host my projects in private repositories, using deploy tokens to allow npm install to download them.
The dependencies are added to the main project using the following format in package.json:
git+https://name:token#gitlab.com/group/project.git
Problem
On Windows when I do a git clone of my main project and run npm install, it does download all the assets using Git LFS, but on Ubuntu the assets aren't getting downloaded. If I check the contents of all the files tracked by Git LFS all I get is the information Git LFS placeholder. I'm using identical commands and software versions on Windows and Ubuntu, but with different results.
I've tried:
Updating to same versions of Node(10.16.0) and Npm(6.10.2) on both Windows and Ubuntu
Updating to the latest versions of Node and Npm (I had to stick to version 10.x for Node because of some dependencies not working with 12.x)
Adding a .lfsconfig file that points to the repository as described in the following issue: https://github.com/npm/npm/issues/11151
Updating Git to the latest version (2.21 on Windows and 2.22 on Ubuntu)
Current workaround
Currently I'm cloning the main project then manually cloning my dependencies into node_modules so that they're all proper git repositories so that I can then use git lfs pull in them. It works, but it's not how it should work, especially not since it's working as it should on Windows.
Question
Why is npm install handling Git LFS differently for dependencies on Ubuntu vs Windows? How do I get npm install to work properly with Git LFS on dependencies, is there a settings somewhere I need to change to e.g. enforce Git LFS downloading?
Step 1. Inside of your repository, run the following command and then commit the resulting .gitconfig and push:
$ git config -f .gitconfig lfs.url https://gitlab.com/group/project.git/info/lfs
Step 2. In the directory in which you want to npm install your project, run for example:
$ npm install -S https://gitlab.com/group/project.git
I have a git repository setup in git lab. Right now each time I change branch i should do:
npm install && composer install && cp .env.example .env && artisan generate key
Cause I lose .env , node_modules and composer modules. and it takes long time reinstalling them. cause I cant run it and test the branch if I dont have node_modules and other stuff installed
I wonder if Im doing something wrong or if there is a way to make it happen.
I have done lots of search but no luck.
Thanks in advance
Are you sure the files / directories you are talking about are ignored by git (they are in your .gitignore file)? If that's not the case, here is the answer to your question:
Since they are bound to the environment you are working on, they should not be touched by git by any means. That's why you should not lose them if you checkout on another branch.
Only the composer.lock, the package-lock.json and the .env.example should be versioned. Then, when you clone the repo from GitLab, you do a npm install, a composer install, you copy the .env.example etc... in order to setup your dependencies, but the dependencies directories (eg. node_modules) should not come from your repository.
Then after a while, let's imagine you want to update your Composer dependencies. You'll do a composer update. Your composer.lock file will be updated and will be committed to your repository.
Then, if somebody on another computer pulls your changes, he will only pull the newly updated composer.lock file. He will then make a composer install, which will install (or update if he already had installed them before) the dependencies from the composer.lock into his vendor folder.
I hope it helps you, feel free to ask more details in the comments :)
I have tried publishing the following repository 3 times and each time npm indicates that it's successful, however I can't pull the the project into other projects using npm i superflycss/utilities-colors#3.0.5 and https://www.npmjs.com/package/#superflycss/utilities-colors is still stuck on version 2.1.6.
Any ideas what the issue could be?
You do not have any tags in your github repo. npm has a command to update the version info. See the docs: https://docs.npmjs.com/getting-started/publishing-npm-packages#how-to-update-a-package
Or you can tag manually with these commands in your shell:
git tag 3.0.5
git push --tags
I have a Bamboo server that is currently setup to test my builds on my project.
I want to start versioning my project using NPM version or grunt bump.
Here is the current Bamboo setup I have,
Bamboo detects repo change
Runs all the test
If the branch is the 'master' branch, then do a post job of moving our production code into an artifactory (we just zip up the appropriate files and drop them into it).
I would like to be able to increment the version between step 2 and 3 if the branch is 'master'.
I'm trying to come up with a good solution for this.
I'm wondering if something like just doing npm version or npm bump is enough? It seems that I would want to them commit that back to the git repo?
Looking for some possible suggestions
First detect that you're on the master branch. If so, do an npm version update. You also need to tell git to push to the remote repository rather than to the repo cached on the Bamboo server. For example, in a script task on your build plan:
npm install
npm run build
if [[ "${bamboo.planRepository.branchName}" == "master" ]]; then
# configure git to use the remote repo
git remote set-url origin ${bamboo.planRepository.1.repositoryUrl}
rm .git/objects/info/alternates
git fetch
# update the local version
# this will increment the last version number, commit and tag the commit
npm version patch
# create your artifact
npm pack
# push the version update
git push
git push --tags
fi
when I tried to use git clone https://xxx I got the following error
I don't handle protocol 'https'
Could anyone please help me?
full message:
dementrock#dementrock-A8Se:~$ git clone https://git.innostaa.com/innostaa.git
Cloning into innostaa...
fatal: Unable to find remote helper for 'https'
dementrock#dementrock-A8Se:~$ git --version
git version 1.7.4
Fixed this problem for Git 1.7.9 on Windows. Seemed to happen with many GIT instantiations on Windows. Had to do with the url not being properly escaped in the command line.
Solution: Put the git repository URL in single quotes 'https://.......'
Version 0.99.9i of git probably does not support https protocol.
Try to install a more recent version of git. The easiest solution would be to install it via apt-get:
$ apt-get update
$ apt-get install git
After that check that the correct version is used:
$ hash -r
$ which git
/usr/bin/git
If the returned string is not /usr/bin/git, then you have another older version of git in your PATH that is masking the more recent one. Remove it.
If you do not want to install git via apt-get or if you do not have administrator privilege on your machine, you can built it from source. You can download them from git website, and compilation should be as simple as:
$ tar -xvfj git-1.7.4.2.tar.bz2
$ cd git-1.7.4.2
$ ./configure --prefix=$HOME/install
$ make && make install
After that, you'll have to add $HOME/install/bin to your PATH.
$ hash -r
$ PATH="$HOME/install/bin:${PATH}"
$ git --version
git version 1.7.4.2
I have same problem but the reason was in my configuration of my .git. I changed config file as follows:
.git/config
enter code here[remote "heroku"]
url = git#heroku.com:rocky-bayou-4315.git
fetch = +refs/heads/*:refs/remotes/heroku/*
rocky-bayou-4315 is my heroku application that has been created by $ heroku create command.
I had the same problem while trying to "fetch upstream". I solved it by getting the Git-read only address instead of the https.
details:
I had a forked repository that needed updated from its original repo. Using github's help I added a remote upstream and tried to fetch it.
I then went to Git-hub and where I usually get the address of the the repo I clicked on the "Git-read only" button and got a new URL. I removed my past upstream and added another one with the new URL, which worked perfectly.
Just encountered this problem with git 1.7.9 on cygwin.
Using the double quotes "" to wrap the https URL can solve my problem.
eg:
git clone "https://github.com/joyent/node.git"