git pull fetch merge

Difference In the simplest terms, git pull does a git fetch followed by a git merge. You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/. This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy. I…

Merge local git repo with the openshift one

Openshift has its own git repo for building/deploying app, so we do not want to push twice and maintain 2 local repo for project. the approach to choose here is to clone your other git repo (ex. on bitbucket) to your local machine: git clone <bitbucket-repo-url> Your local clone has then your other repo (bitbucket…

merge audio and video from youtube.

Recently youtube has separated the video and audio file while you download stuff from it. You might end up with 2 mp4 files: one for video and other for audio. To merge them, a easy way is to use the ffmpeg. The command could be: ffmpeg.exe -i pathOfAudio -i pathOfVideo -acodec copy -vcodec copy output.mp4 To make…

“detached entity passed to persist error” with JPA

I got the answer, I was using: em.persist(user); I used merge in place of persist: em.merge(user); Here .persist() only will insert the record.If we use .merge() it will check is there any record exist with the current ID,If it exist it will update otherwise it will insert new record.    The error you described occurs…

jpa merge vs persist

Either way will add an entity to a PersistenceContext, the difference is in what you do with the entity afterwards. Persist takes an entity instance, adds it to the context and makes that instance managed (ie future updates to the entity will be tracked) Merge creates a new instance of your entity, copies the state…