Configuring git repo - Ubuntu Server

I have started working on a project where the code at this moment is only on the ubuntu server. Site is big, it is a Magento based project. I am not sure how to proceed to configure it to use git.Should I:run git init on the server, add & commit, add server ssh key to github, add remote to the repo and push all? then just create a cron to run pull everynow and then?Download site, handle repo locally, add & commit, add server ssh key to github, add remote to the repo and push all. Then how I would update server code?thanks in advance for...Read more

Set GIT_DISCOVERY_ACROSS_FILESYSTEM to allow service to access git repo stored under a symlink

We have an Upstart service/job that uses a local clone of a git repo. After relocating the data folder using a symbolic link we now get the following error message: Failed to run 'git fetch' for /var/company/service/src/program repo; Details: fatal: Not a git repository (or any parent up to mount point /data) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).How can I set GIT_DISCOVERY_ACROSS_FILESYSTEM for the service?...Read more

How to merge a specific commit in Git

I have forked a branch from a repository in GitHub and committed something specific to me. Now I found the original repository had a good feature which was at HEAD.I want to merge it only without previous commits. What should I do? I know how to merge all commits:git branch -b a-good-featuregit pull repository mastergit checkout mastergit merge a-good-featuregit commit -agit push...Read more

How do you merge two Git repositories?

Consider the following scenario:I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big repository. I'd now like to add A as a subdirectory of B.How do I merge A into B, without losing history on any side?...Read more

git - Merge branch with cherry-picked commit from local branch without any conflict

When I cherry-pick commits from another branch, and then try to merge it. Ifmore changed have been applied I have merge conflicts.A good example, is if I have follow the 'gitflow' cliché way of doing git(master, develop, feature/bugfix, hotfix). Here's the steps:I merge a bugfix into developI merge some more feature into developI cherry-pick my old bugfix and apply it as a hotfix onto masterIf I merge master back into develop I get a merge conflict.If I checkout my bugfix merge commit, then merge master (thus creating this"in-between" merge), a...Read more

Programmatically pre-merge in mercurial (or git)

There are certain common, uninformative merge conflicts we experience regularly, particularly when merging regression test outputs. I'd like to be able to programmatically ignore lines matching certain patterns (e.g., "if a line or region matches this regexp, just take the patch from other"), but then I still want to hand off to an interactive merge tool to handle other conflicts in the file if there are any (without having to manually re-merge those first lines.)If I pre-merge with any tool (like :merge3 or any I might devise) and then re-mer...Read more

git - Why cannot I create a pull request for a commit and how can I workaround it?

I had made 4 commits and a pull request for the last one. Merged that pull request.New information appeared and I have to return back to the second commit.I had "reset current branch" in Git-extensions to the second commit.I had created a new branchI had force pushed the branchI had tried to create a new pull request. -> I cannot, getting: Branch "target" is already up-to-date with branch "the-name-of-the-new-branch" in repository "repo".If I am doing it remaining in the old branch, reaction is the same, only the name of the branch is different...Read more

npm - permission denied while trying to create leading directories of git clone

Whenever I try to run npm install on my app, I get the following error:Eliyas-MacBook-Pro:app-name root# npm installnpm ERR! code 128npm ERR! Command failed: /usr/bin/git clone -q /var/root/.npm/_cacache/tmp/git-clone-31357d5enpm ERR! fatal: could not create leading directories of '/var/root/.npm/_cacache/tmp/git-clone-31357d5e': Permission deniednpm ERR! npm ERR! A complete log of this run can be found in:npm ERR! /var/root/.npm/_logs/2018-02-27T20_18_34_759Z-debug.logThis is ...Read more

git - Conflict in merging from upstream

I am working on an open source project with a company. I forked their repo and cloned the repo on my machine and set my master branch to track company's original repo. I started working on the project and made some changes in a new branch. In the meanwhile, the organization made around 1000 commits. Now when I want to merge my master with upstream using the command :git fetch upstreamgit merge upstream/masterThe git console shows the following error for multiple files.Auto-merging file-pathCONFLICT (add/add): Merge conflict in file-pathTo push...Read more

git - How does cocoapods determine which files from source to keep in installation?

As an example, let's use the AdColony video ad platform. I put pod 'AdColony' into my Podfile and after running pod install, my Pods directory has an AdColony folder in it (and the Xcode project is configured to be able to use it).Now, that folder contains two items: the AdColony.framework iOS framework, and a file. Exactly what you need, right? However, things get mysterious when diving a little bit deeper.The AdColony Cocoapods page has a link to the Podspec. In it, we have the following entry:"source": {"git": " more

git - Delete remote branch in SAP Web IDE

I created a remote Branch but with the wrong name and now I want to delete the remote branch. The problem is I don't now how because if I right-click one the Project->Git there is only an option to create a remote branch but no option to delete one. I hope you can help me....Read more

How to iterate through all git branches using bash script

How can I iterate through all the local branches in my repository using bash script.I need to iterate and check is there any difference between the branch and some remote branches.Exfor branch in $(git branch); do git log --oneline $branch ^remotes/origin/master;doneI need to do something like given above, but the issue I'm facing is $(git branch) gives me the folders inside the repository folder along with the branches present in the repository.Is this the correct way to solve this issue? Or is there another way to do it?Thank you...Read more

git - Jenkins pipeline build github pull request

given that I use the pipeline plugin + all the github plugin are installed in jenkins, I'm struggled to checkout the current pull request that triggered the job in the pipeline script like this : #!groovy node('master') { stage 'Checkout' checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: "origin/????"]], doGenerateSubmoduleConfigurations: false, submoduleCfg: [], userRemoteConfigs: [[name: 'origin', url: '', credentialsId: 'github-id']]] }but I don't find any way to get the current p...Read more

Nested gradle git commands

I want to create a commandline gradle function that will allow me to run nested git commandsfor example def nestedCommand(){ exec{ commandLine "git", "commit" "-am", "`git describe -g`" }}What do I need to do to make it work? The syntax is incorrect...Read more