messages
listlengths 3
3
|
---|
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitLab Runner not picking up jobs automatically after reboot\n\nSo our GitLab Runner was running fine for a few weeks now. I had to do some upgrades that required a reboot on the machine where it is installed.\nAfter rebooting it no longer picks up jobs automatically. All my pipelines say they're stuck because there are no runners that could pick the jobs up.\nI SSH'd into the machine and ran\nsudo gitlab-runner run\n\nand the jobs get picked up as I expect them to be. However when I press CTRL + C it stops any picked up jobs and stops picking up any other jobs again. How do I fix this so that it's back to how it was before the reboot?\nAdditional Info\nWhen I ran\nsudo gitlab-runner start\n\nI got an error saying: FATAL: Failed to start gitlab-runner: \"systemctl\" failed: exit status 5, Failed to start gitlab-runner.service: Unit gitlab-runner.service not found.\nA similar error also popped up when I ran\nsudo gitlab-runner restart"
},
{
"role": "assistant",
"content": "So from the error message above it's saying the service isn't installed yet (not sure why). Running \ngitlab-runner status\n\ndoes say gitlab-runner: Service is not installed.\nSo I did\ngitlab-runner install -u gitlab-runner\n\nI'm not sure whether gitlab-runner is the default user that was used before this issue came up but I'll just use that here for now at least.\nAfter installing the service I just issued\ngitlab-runner start\n\nAnd the jobs are getting picked up automatically again.\n\nMy only guess as to why this happened is because I ran apt-get upgrade which tried to upgrade all components with an update available which of course updated our version of GitLab Runner. Somehow that uninstalls the service? I'm not sure."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options plain"
},
{
"role": "assistant",
"content": "show in one column"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-show-ref - List references in a local repository -q --quiet"
},
{
"role": "assistant",
"content": "Do not print any results to stdout. Can be used with --verify to\nsilently check if a reference exists."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git equivalent of svn status -u\nWhat's the git equivalent of svn status -u or more verbose svn status --show-updates. \nThe svn status --show-updates command shows the updates that the svn update command will bring from the server.\nThanks!"
},
{
"role": "assistant",
"content": "I can't think of a way to do it without actually fetching the updates (maybe someone else will). Assuming you are on the default branch \"master\" and the upstream from which these hypothetical updates will come is the default remote \"origin\", try....\ngit fetch\ngit log --name-only ..origin/master\n\nNote the double dots .. not a single dot or an elipsis1.\nThis will give you a list of log entries for changes that are only upstream, with the filenames affected, you can alter the parameters to git log to get more or less information.\nNB in git \"fetching\" these updates isn't the same as applying them to your local branch. You no doubt already know how to do that with git pull.\n\n1 As for where do the double dots come from, name1..name2 indicates a range. If name1 is omitted, HEAD is used in its place. This syntax refers to all commits reachable from name2 back to, but not including, HEAD. [\"Git from the bottom up\"]"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-grep - Print lines matching a pattern -F --fixed-strings"
},
{
"role": "assistant",
"content": "Use fixed strings for patterns (don’t interpret pattern\nas a regex)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs --since-as-filter=<date>"
},
{
"role": "assistant",
"content": "Show all commits more recent than a specific date. This visits\nall commits in the range, rather than stopping at the first commit which\nis older than a specific date."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitignore by file size?\nI'm trying to implement Git to manage creative assets (Photoshop, Illustrator, Maya, etc.), and I'd like to exclude files from Git based on file size rather than extension, location, etc.\nFor example, I don't want to exclude all .avi files, but there are a handful of massive +1GB avi files in random directories that I don't want to commit. \nAny suggestions?"
},
{
"role": "assistant",
"content": "I'm new to .gitignore, so there may be better ways to do this, but I've been excluding files by file size using:\nfind . -size +1G | cat >> .gitignore\n\nObviously you'll have to run this code frequently if you're generating a lot of large files."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I filter all GitHub pull requests for a specific target branch\nI'm working on a GitHub repo with lots of branches and pull requests.\nLet's say, for example, that I have the following pull requests:\n\na to branch X\nb to branch X\nc to branch Y\nd to branch X\ne to branch Y.\n\nIs there a way to find all the pull requests that are targeted for branch X (i.e. a -> X, b -> X, d -> X)?"
},
{
"role": "assistant",
"content": "Yes, you can do it.\nIn Github's terminology the \"to branch\" is \"base\"\nSo the search phrase is: is:open is:pr base:X\nOfficial description: Search based on branch names\nOptionally you can add is:merged or is:unmerged filters as well."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-grep - Print lines matching a pattern -<num> -C <num> --context <num>"
},
{
"role": "assistant",
"content": "Show <num> leading and trailing lines, and place a line\ncontaining -- between contiguous groups of matches."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-clone - Clone a repository into a new directory --shallow-since= <date>"
},
{
"role": "assistant",
"content": "Create a shallow clone with a history after the specified time."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I find the next commit in Git? (child/children of ref)\nref^ refers to the commit before ref. What about getting the commit after ref?\nFor example, if I git checkout 12345, how do I check out the next commit?\nYes, Git's a DAG node pointer struct tree whatever. How do I find the commit after this one?"
},
{
"role": "assistant",
"content": "To list all the commits, starting from the current one, and then its child, and so on - basically standard git log, but going the other way in time, use something like\ngit log --reverse --ancestry-path 894e8b4e93d8f3^..master\n\nwhere 894e8b4e93d8f3 is the first commit you want to show.\nN.b. When using a DOS command prompt, you must escape the caret:\ngit log --reverse --ancestry-path 894e8b4e93d8f3^^..master"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker GIT_SSL_NO_VERIFY"
},
{
"role": "assistant",
"content": "Setting and exporting this environment variable to any value\ntells Git not to verify the SSL certificate when fetching or\npushing over HTTPS."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Commit empty folder structure (with git) [duplicate]\nThis question already has answers here:\n \n \n\n\n\n\nHow do I add an empty directory to a Git repository?\n\n (37 answers)\n \n\nClosed 4 years ago.\n\n\n\nI have data directory in project's root. It has images directory and some files. Here is example:\ndata\n├── images\n│ ├── image1.jpg\n│ ├── image2.jpg\n│ └── image3.jpg \n├── results.csv\n└── r.txt\n\nWhat to write in gitignore, to ignore files from data/ directory (that is results.csv and r.txt) and files from images/ directory (image.jpg, image2.jpg, image3.jpg)?\nWhen I commit it, folder structure in repository should be:\ndata/\n└── images/\n\nSo, I just want empty folder structure to be commited."
},
{
"role": "assistant",
"content": "Just add a file .gitkeep in every folder you want committed.\nOn windows do so by right clicking when in the folder and select: Git bash from here. Then type: touch .gitkeep"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-show - Show various types of objects --ignore-blank-lines"
},
{
"role": "assistant",
"content": "Ignore changes whose lines are all blank."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-commit - Record changes to the repository --branch"
},
{
"role": "assistant",
"content": "Show the branch and tracking info even in short-format."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rebase - Reapply commits on top of another base tip -q --quiet"
},
{
"role": "assistant",
"content": "Be quiet. Implies --no-stat ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I make Git treat a file as binary?\nHaving a problem with a medium sized project where visual studio project files keep having issues due to git treating them as text and merging. I'd like to just set the file as binary so that git won't auto merge these files ever. \nIs there a way to do this?"
},
{
"role": "assistant",
"content": "Yes, using attributes. Put something like this in your .gitattributes file (create it if it doesn't exist):\n*.sln binary\n*.suo binary\n*.vcxproj binary\n\nHere binary is actually a predefined macro, equivalent to -diff -merge -text.\nIf you want to still be able to see the diff, you can use:\n*.sln -merge -text\n\nThis way, the *.sln files won't be merged, not have eol normalized, but meanwhile diff-able."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-worktree - Manage multiple working trees --[no-]guess-remote"
},
{
"role": "assistant",
"content": "With worktree add <path> , without <commit-ish> , instead\nof creating a new branch from HEAD , if there exists a tracking\nbranch in exactly one remote matching the basename of <path> ,\nbase the new branch on the remote-tracking branch, and mark\nthe remote-tracking branch as \"upstream\" from the new branch. This can also be set up as the default behaviour by using the worktree.guessRemote config option."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git log/show etc. replaces the terminal screen\nI recently started to use zsh (oh-my-zsh, without customizations) on iTerm2. But, I'm having a trouble in git log or git show.\nPreviously, for example, the git log results were just a part of the terminal, just like ls -l result. After quitting git log by pressing q key, the result was remained in the terminal screen. I was able to pick some hash id easily.\nHowever, the current problem is that git log (or git show) results replace the screen. So, after quitting git log, the terminal completely removes all git results and returns to the original screen. This behavior is like vim.\nThis behavior is the same even with bash or Mac's default terminal app. This is not a problem of --no-pager.\nAny helps would be appreciated."
},
{
"role": "assistant",
"content": "oh-my-zsh executes less with -R flag, You may run unset LESS to fallback to default behaviour.\nIf you want to make this change persistent, put this command to .zshrc."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitLab CI runner can't connect to unix:///var/run/docker.sock in kubernetes\n\nGitLab's running in kubernetes cluster. Runner can't build docker image with build artifacts. I've already tried several approaches to fix this, but no luck. Here are some configs snippets:\n.gitlab-ci.yml\nimage: docker:latest\nservices:\n - docker:dind\n\nvariables:\n DOCKER_DRIVER: overlay\n\nstages:\n - build\n - package\n - deploy\n\nmaven-build:\n image: maven:3-jdk-8\n stage: build\n script: \"mvn package -B --settings settings.xml\"\n artifacts:\n paths:\n - target/*.jar\n\ndocker-build:\n stage: package\n script:\n - docker build -t gitlab.my.com/group/app .\n - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.my.com/group/app\n - docker push gitlab.my.com/group/app\n\nconfig.toml\nconcurrent = 1\ncheck_interval = 0\n\n[[runners]]\n name = \"app\"\n url = \"https://gitlab.my.com/ci\"\n token = \"xxxxxxxx\"\n executor = \"kubernetes\"\n [runners.kubernetes]\n privileged = true\n disable_cache = true\n\nPackage stage log:\nrunning with gitlab-ci-multi-runner 1.11.1 (a67a225)\n on app runner (6265c5)\nUsing Kubernetes namespace: default\nUsing Kubernetes executor with image docker:latest ...\nWaiting for pod default/runner-6265c5-project-4-concurrent-0h9lg9 to be running, status is Pending\nWaiting for pod default/runner-6265c5-project-4-concurrent-0h9lg9 to be running, status is Pending\nRunning on runner-6265c5-project-4-concurrent-0h9lg9 via gitlab-runner-3748496643-k31tf...\nCloning repository...\nCloning into '/group/app'...\nChecking out 10d5a680 as master...\nSkipping Git submodules setup\nDownloading artifacts for maven-build (61)...\nDownloading artifacts from coordinator... ok id=61 responseStatus=200 OK token=ciihgfd3W\n$ docker build -t gitlab.my.com/group/app .\nCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\nERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1\n\nWhat am I doing wrong?"
},
{
"role": "assistant",
"content": "Don't need to use this: \nDOCKER_DRIVER: overlay\n\ncause it seems like OVERLAY isn't supported, so svc-0 container is unable to start with it:\n$ kubectl logs -f `kubectl get pod |awk '/^runner/{print $1}'` -c svc-0\ntime=\"2017-03-20T11:19:01.954769661Z\" level=warning msg=\"[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]\"\ntime=\"2017-03-20T11:19:01.955720778Z\" level=info msg=\"libcontainerd: new containerd process, pid: 20\"\ntime=\"2017-03-20T11:19:02.958659668Z\" level=error msg=\"'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.\"\n\nAlso, add export DOCKER_HOST=\"tcp://localhost:2375\" to the docker-build:\n docker-build:\n stage: package\n script:\n - export DOCKER_HOST=\"tcp://localhost:2375\"\n - docker build -t gitlab.my.com/group/app .\n - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.my.com/group/app\n - docker push gitlab.my.com/group/app"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-stash - Stash the changes in a dirty working directory away -S --staged"
},
{
"role": "assistant",
"content": "This option is only valid for push and save commands. Stash only the changes that are currently staged. This is similar to\nbasic git commit except the state is committed to the stash instead\nof current branch. The --patch option has priority over this one."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git credential helper - update password\n\nI'm currently using GitHub over HTTPS and have the latest version of Git installed (1.9.0) along with the Git credential helper on Windows 7.\nOn setting up my environment, I told git-credentials to permanently remember my username and password.\nI've recently updated my GitHub password via the website and I'm now no longer able to push/pull/fetch, etc. \nHow I would go about updating my password on git-credentials helper on Windows 7?"
},
{
"role": "assistant",
"content": "None of these answers ended up working for my Git credential issue. Here is what did work if anyone needs it (I'm using Git 1.9 on Windows 8.1).\nTo update your credentials, go to Control Panel → Credential Manager → Generic Credentials. Find the credentials related to your Git account and edit them to use the updated password.\nReference: How to update your Git credentials on Windows\nNote that to use the Windows Credential Manager for Git you need to configure the credential helper like so:\ngit config --global credential.helper wincred\n\nIf you have multiple GitHub accounts that you use for different repositories, then you should configure credentials to use the full repository path (rather than just the domain, which is the default):\ngit config --global credential.useHttpPath true"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options help.format"
},
{
"role": "assistant",
"content": "Override the default help format used by git-help .\nValues man , info , web and html are supported. man is\nthe default. web and html are the same."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git merge branch into master\nI have a master branch and a working branch_1. I want to 'move' branch_1 exactly as it is to master. So I want something like this:\ngit checkout master\ngit merge branch_1 # I don't know what is correct...\n\nThings which I did but I got loads of files messed up with annoying conflicts. So now master contains exactly the same files of branch_1 avoiding any conflicts, just overwriting files.\nAny help?"
},
{
"role": "assistant",
"content": "Conflicts are going to happen if both branches have changes to the files. This is a good thing. Keeping your branches up-to-date with each other will prevent some of them\n. However over all, conflicts are not bad. The rebase option can also prevent many of them from happening.\ngit merge branch_1\n\nIf you are on master, merging will bring the changes as you expect.\nhttp://www.kernel.org/pub/software/scm/git/docs/git-merge.html\nYou could also\ngit rebase branch_1\n\nThis will take the changes from branch_1 and append them to master without a merge commit.\nhttp://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to hard delete an orphan commit in git?\nI have local commit that are not on any branch that I would like to delete.\nI don't want to rebase them, I really want to delete them, and loose all the content related to these commit.\nIs their a command to do so ?\nSo far I've tried interactive rebase as many suggested, but it just move commit around, it doesn't delete them. I've also tried to use reflog delete, but I can't figure out how to pass a specific commit Id to the command.\nHere's the working tree:\no [master] Commit #6 \n| \no Commit #5 \n| \n| o Commit #4 \n|/ \no Commit #3 \n| \no Commit #2 \n| \no Commit #1 \n\nI want to physically delete the commit #4."
},
{
"role": "assistant",
"content": "If the commit is not referenced by anything, it will be removed with git's garbage collection, in time. \nIf you want to force it before hand, use git gc --prune=now --aggressive"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to add chmod permissions to file in Git?\nI would git commit a .sh file, but would like it to be executable when I checkout that same file in another server.\nIs there a way to do so without manually chmod u+x that file in the servers that checkout the file?"
},
{
"role": "assistant",
"content": "According to official documentation, you can set or remove the \"executable\" flag on any tracked file using update-index sub-command.\nTo set the flag, use following command:\ngit update-index --chmod=+x path/to/file\n\nTo remove it, use:\ngit update-index --chmod=-x path/to/file\n\nUnder the hood\nWhile this looks like the regular unix files permission system, actually it is not. Git maintains a special \"mode\" for each file in its internal storage:\n\n100644 for regular files\n100755 for executable ones\n\nYou can visualize it using ls-file subcommand, with --stage option:\n$ git ls-files --stage\n100644 aee89ef43dc3b0ec6a7c6228f742377692b50484 0 .gitignore\n100755 0ac339497485f7cc80d988561807906b2fd56172 0 my_executable_script.sh\n\nBy default, when you add a file to a repository, Git will try to honor its filesystem attributes and set the correct filemode accordingly. You can disable this by setting core.fileMode option to false:\ngit config core.fileMode false\n\nTroubleshooting\nIf at some point the Git filemode is not set but the file has correct filesystem flag, try to remove mode and set it again:\ngit update-index --chmod=-x path/to/file\ngit update-index --chmod=+x path/to/file\n\nBonus\nStarting with Git 2.9, you can stage a file AND set the flag in one command:\ngit add --chmod=+x path/to/file"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What does \"git remote\" mean?\nWhat does \"remote\" mean? When cloning a repository located at a central location, aren't we creating its remote version?\nWhen I execute the command\n$ git remote\n\nI get origin. What does this mean?\nWhen I execute\n$ git branch -r\n\nI get origin/master. Now what is this?"
},
{
"role": "assistant",
"content": "I found a fantastic answer here:\n\nAs you probably know, git is a distributed version control system. Most operations are done locally. To communicate with the outside world, git uses what are called remotes. These are repositories other than the one on your local disk which you can push your changes into (so that other people can see them) or pull from (so that you can get others changes). The command git remote add origin [email protected]:peter/first_app.git creates a new remote called origin located at [email protected]:peter/first_app.git. Once you do this, in your push commands, you can push to origin instead of typing out the whole URL. \n\nI would recommend reading the whole answer."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Is there any way to check what gulp version you have installed?\nIs there any way to check what gulp version you have installed and also what version of gulp is being offered by the website? I've searched online, and looked at the gulp website, but cannot find the version I need to put in my JSON file."
},
{
"role": "assistant",
"content": "Simply use: gulp -v\nFrom the docs:\nhttps://github.com/gulpjs/gulp/blob/master/docs/CLI.md"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to split the last commit into two in Git?\nI have two branches, master and forum, and I've just made some modifications in forum that I'd like to cherry-pick into master. But unfortunately, the commit I want to cherry-pick also contains some modifications that I don't want.\nThe solution would probably be to somehow delete the wrong commit and replace it with two separate commits, one with changes I want to pick in master, the other with the remaining changes.\nI've tried doing\ngit reset --hard HEAD^\n\nwhich deleted all changes, so I had to go back with\ngit reset ORIG_HEAD\n\nSo my question is, what is the best way to split the last commit into two separate commits?"
},
{
"role": "assistant",
"content": "You should use the index. After doing a mixed reset (\"git reset HEAD^\"), add\nthe first set of changes into the index, then commit them. Then commit the\nrest.\nYou can use \"git add\" to put all changes made in a file to the index. If you\ndon't want to stage every modification made in a file, only some of them, you\ncan use \"git add -p\".\nLet's see an example. Let's suppose I had a file called myfile, which contains\nthe following text:\nsomething\nsomething else\nsomething again\n\nI modified it in my last commit so that now it looks like this:\n1\nsomething\nsomething else\nsomething again\n2\n\nNow I decide that I want to split it into two, and I want the insertion of the\nfirst line to be in the first commit, and the insertion of the last line to be\nin the second commit.\nFirst I go back to HEAD's parent, but I want to keep the modifications in file system,\nso I use \"git reset\" without argument (which will do a so-called \"mixed\"\nreset):\n$ git reset HEAD^\nmyfile: locally modified\n$ cat myfile\n1\nsomething\nsomething else\nsomething again\n2\n\nNow I use \"git add -p\" to add the changes I want to commit to the index (=I\nstage them). \"git add -p\" is an interactive tool that asks you about what\nchanges to the file should it add to the index.\n$ git add -p myfile\ndiff --git a/myfile b/myfile\nindex 93db4cb..2f113ce 100644\n--- a/myfile\n+++ b/myfile\n@@ -1,3 +1,5 @@\n+1\n something\n something else\n something again\n+2\nStage this hunk [y,n,a,d,/,s,e,?]? s # split this section into two!\nSplit into 2 hunks.\n@@ -1,3 +1,4 @@\n+1\n something\n something else\n something again\nStage this hunk [y,n,a,d,/,j,J,g,e,?]? y # yes, I want to stage this\n@@ -1,3 +2,4 @@\n something\n something else\n something again\n+2\nStage this hunk [y,n,a,d,/,K,g,e,?]? n # no, I don't want to stage this\n\nThen I commit this first change:\n$ git commit -m \"Added first line\"\n[master cef3d4e] Added first line\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\nNow I can commit all the other changes (namely the numeral \"2\" put in the last line):\n$ git commit -am \"Added last line\"\n[master 5e284e6] Added last line\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\nLet's check the log to see what commits we have:\n$ git log -p -n2 | cat\nCommit 5e284e652f5e05a47ad8883d9f59ed9817be59d8\nAuthor: ...\nDate: ...\n\n Added last line\n\nDiff --git a/myfile b/myfile\nIndex f9e1a67..2f113ce 100644\n--- a/myfile\n+++ b/myfile\n@@ -2,3 +2,4 @@\n something\n something else\n something again\n+2\n\nCommit cef3d4e0298dd5d279a911440bb72d39410e7898\nAuthor: ...\nDate: ...\n\n Added first line\n\nDiff --git a/myfile b/myfile\nIndex 93db4cb..f9e1a67 100644\n--- a/myfile\n+++ b/myfile\n@@ -1,3 +1,4 @@\n+1\n something\n something else\n something again"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-merge-base - Find as good common ancestors as possible for a merge --is-ancestor"
},
{
"role": "assistant",
"content": "Check if the first <commit> is an ancestor of the second <commit>,\nand exit with status 0 if true, or with status 1 if not.\nErrors are signaled by a non-zero status that is not 1."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-checkout-index - Copy files from the index to the working tree"
},
{
"role": "assistant",
"content": "DESCRIPTION Copies all listed files from the index to the working directory\n(not overwriting existing files)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-show - Show various types of objects --patch-with-raw"
},
{
"role": "assistant",
"content": "Synonym for -p --raw ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to clone a Github Gist via SSH protocol?\nGithub really seems to want us to use the HTTPS protocol to use Gists, for example, they only list the HTTPS url on a Gist page - e.g. https://gist.github.com/donatello/5834862\nIs it possible to clone a Gist using SSH protocol?"
},
{
"role": "assistant",
"content": "Yes, it is possible:\ngit clone [email protected]:5834862.git\n\nJust replace with your own Gist ID of course."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Error with 'Git push heroku master' command\nI am trying to update the code from my application to my repository and an error appears.\nHow can I fix it?\nC:\\Sites\\ecozap>git push heroku master\nEnter passphrase for key '/c/Users/Diseño2/.ssh/id_rsa':\nFetching repository, done.\nTo [email protected]:ecozap.git\n! [rejected] master -> master (non-fast-forward)\nerror: failed to push some refs to '[email protected]:ecozap.git'\nhint: Updates were rejected because the tip of your current branch is behind\nhint: its remote counterpart. Merge the remote changes (e.g. 'git pull')\nhint: before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details."
},
{
"role": "assistant",
"content": "This error means that the master branch on Heroku contains commits that are not in your local branch.\nYou can either pull the missing commits from Heroku and merge them into your local copy:\ngit pull heroku master\n\nOr, if you don't care about the missing commits you can force push to Heroku. This will overwrite the remote repo on Heroku with your local commits.\ngit push --force heroku master\n\nMake sure you really don't care about them as you will lose them from Heroku by doing this. Normally this doesn't matter as Heroku is not normally the canonical repo, somewhere else such as GitHub is."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index -M[<n>] --find-renames[=<n>]"
},
{
"role": "assistant",
"content": "Detect renames.\nIf n is specified, it is a threshold on the similarity\nindex (i.e. amount of addition/deletions compared to the\nfile’s size). For example, -M90% means Git should consider a\ndelete/add pair to be a rename if more than 90% of the file\nhasn’t changed. Without a % sign, the number is to be read as\na fraction, with a decimal point before it. I.e., -M5 becomes\n0.5, and is thus the same as -M50% . Similarly, -M05 is\nthe same as -M5% . To limit detection to exact renames, use -M100% . The default similarity index is 50%."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "SourceTree - git: fatal: remote error: Repository not found\n\nI just signed up for a github account at work and created a new repository. I ran a few git commands over command line and everything worked fine. \n1. git init \n2. git add .\n3. git commit -m \"first commit\"\n4. git remote add origin https://github.com/username/project.git\n\nThen, when I added the working copy from sourcetree and clicked the Fetch button, i get \"error: Repository Not Found\". I try push and pull and i get the same error. I've been using sourcetree with my bitbucket and github repositories for a few months now but i've never had this problem. Has anyone had similar issues?"
},
{
"role": "assistant",
"content": "Had the same issue. The reason in my case was that I authenticated via https on command line but then used sourceTree via oAuth. Setting the Auth type to \"Basic\" in my Account settings helped."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Proper way to use Gitflow with pull requests\n\nI would like to adopt the git-flow tool inside my team.\nThe problem is that \"git flow feature finish\" merges the branches locally.\nAnd I want to create a pull request instead. Thus, the merge will happen in the origin.\nSo, what is the right way to use the git-flow tool in teams that also work with pull requests?\nTried to google it but could not find something meaningful."
},
{
"role": "assistant",
"content": "You can just use the git flow feature publish <name>this will publish your feature branch to your origin (like Bitbucket). Then you can create the pull request there and merge it into develop. After that is done, you need to manually delete the local feature branch.\nThe only command you can not use is git flow feature finish <name>. This works fairly well and you can still use most of the git flow helpers.\nThe same goes for releases. I found this article helpfull: https://blog.axosoft.com/pull-requests-gitflow/\nAs well as https://community.atlassian.com/t5/Bitbucket-questions/git-flow-feature-finish-and-pull-request/qaq-p/347877\nHope this helps a little. There is just not the one perfect solution to this problem."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to do a rebase with git gui?\nI know how to do a git rebase from the command line, but how do you do it with the official git-gui?"
},
{
"role": "assistant",
"content": "Add this to the .gitconfig file in your home directory to add rebase commands to the Tools menu:\n[guitool \"Rebase onto...\"]\n cmd = git rebase $REVISION\n revprompt = yes\n[guitool \"Rebase/Continue\"]\n cmd = git rebase --continue\n[guitool \"Rebase/Skip\"]\n cmd = git rebase --skip\n[guitool \"Rebase/Abort\"]\n cmd = git rebase --abort\n[guitool \"Pull with Rebase\"]\n cmd = git pull --rebase"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Can I create more than one repository for GitHub Pages?\n\nI created a repository for hosting a blog on GitHub.\nIs there any way that I can create additional repositories to host multiple blogs, or am I limited to just one since username.github.io can only be used once?"
},
{
"role": "assistant",
"content": "You can have one site published to https://<username>.github.io by publishing to the master branch of a repository named “username.github.io” (substituting your actual username).\nYou can also have an additional site per GitHub project published to https://<username>.github.io/<project>. Project settings let you choose which branch and directory to publish.\nA better description is available in the GitHub Pages documentation, including options for using custom domain names.\n(since April 2013, all username.github.com are now username.github.io)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What do git checkouts really mean?\nWhat are checkouts in git? \nI know once you do checkout to a particular branch, the HEAD points to that branch. But what does it really mean? Does it mean I can then work on that branch? If yes, then, without checking out a branch, I am not able to work on it?\nAlso, what does remote checkout mean? How is it useful?"
},
{
"role": "assistant",
"content": "As you noted, HEAD is a label noting where you are in the commit tree. It moves with you when you move from one commit to another. git checkout <commit> is the basic mechanism for moving around in the commit tree, moving your focus (HEAD) to the specified commit.\nThe commit can be specified by any of a number of ways, commit hash, branch name, tag name, the relative syntax (HEAD^, HEAD~1, etc.) and so on. It is often useful to consider a checkout to be changing branches, and there are some options that work from that perspective, but they all reference commits.\nTo checkout a commit has some side effects other than moving HEAD around.\n\nThe working directory is updated to the state of the checked out commit.\nif a branch name is specified, checkout makes that branch active. The active branch will move along with any new commits that are added.\n\nwith the -b option a new branch will be created based on the current commit and then made active.\nwith the --track option the checked out branch can be made aware of a remote branch\nwith the --orphan option a new branch is created (like with -b) but will not be based on any existing commit.\n\n\n\nThere are a few more options, which you can read about in the git checkout man-page, all of which revolve around moving from one commit to another -- just varying in what effect that move has in addition to moving HEAD."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git working on two branches simultaneously\nI have a project with many branches.\nI would like to work on several branches simultaneously without switching back and forth with git checkout.\nIs there any way I can do that besides copying the whole repository somewhere else?"
},
{
"role": "assistant",
"content": "Git 2.5+ (Q2 2015) supports this feature!\nIf you have a git repo cool-app, cd to root (cd cool-app), run git worktree add ../cool-app-feature-A feature/A. This checks out the branch feature/A in it's own new dedicated directory, cool-app-feature-A.\nThat replaces an older script contrib/workdir/git-new-workdir, with a more robust mechanism where those \"linked\" working trees are actually recorded in the main repo new $GIT_DIR/worktrees folder (so that work on any OS, including Windows).\nAgain, once you have cloned a repo (in a folder like /path/to/myrepo), you can add worktrees for different branches in different independent paths (/path/to/br1, /path/to/br2), while having those working trees linked to the main repo history (no need to use a --git-dir option anymore)\nSee more at \"Multiple working directories with Git?\".\nAnd once you have created a worktree, you can move or remove it (with Git 2.17+, Q2 2018)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Android Studio Git .gitignore vs Project > Settings > Version Control > Ignored Files\nI am somewhat confused, I noticed that upon setting up my first Git repository in Android Studio all of the correct files to ignore were automatically added to the Project's Settings under Settings > Version Control > Ignored Files.\nThis appeared to be magic, I never told it what to ignore. Moreover, there is no .gitignore file in any directory of my project as I'm used to creating.\nThis being said, I can't get my second project to automatically add ignored files, and really, I just want to use the simple .gitignore method.\nDoes anyone know how to override Android Studio's ignored files list and simply use a .gitignore instead? I'd like the ease of copying my .gitignore to all other projects I make, it does not appear you can copy Settings > Version Control > Ignored Files.\nThank you for commenting on how I can just use .gitignore."
},
{
"role": "assistant",
"content": "Ok to answer my own question. To go back to using .gitignore, do the following:\n\nGo to Settings > Version Control > Ignored Files and remove all ignored files. Hit Apply.\nStill in Settings > Version Control change the type of version control from Git to none. Hit Apply.\nDelete the project's .git directory created previously.\nCreate the following .gitignore file in the root directory of your project:\nhttps://stackoverflow.com/a/21049338/459095\nVCS > Enable Version Control... to Re-enable Git.\nThen right click on the project root and select Git > Add to add the entire project.\n\nDoing the above will utilize the .gitignore file instead of Settings > Version Control > Ignored Files to commit the right files."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-read-tree - Reads tree information into the index"
},
{
"role": "assistant",
"content": "MERGING If -m is specified, git read-tree can perform 3 kinds of\nmerge, a single tree merge if only 1 tree is given, a\nfast-forward merge with 2 trees, or a 3-way merge if 3 or more trees are\nprovided. Single Tree Merge If only 1 tree is specified, git read-tree operates as if the user did not\nspecify -m , except that if the original index has an entry for a\ngiven pathname, and the contents of the path match with the tree\nbeing read, the stat info from the index is used. (In other words, the\nindex’s stat()s take precedence over the merged tree’s). That means that if you do a git read-tree -m <newtree> followed by a git checkout-index -f -u -a , the git checkout-index only checks out\nthe stuff that really changed. This is used to avoid unnecessary false hits when git diff-files is\nrun after git read-tree . Two Tree Merge Typically, this is invoked as git read-tree -m $H $M , where $H\nis the head commit of the current repository, and $M is the head\nof a foreign tree, which is simply ahead of $H (i.e. we are in a\nfast-forward situation). When two trees are specified, the user is telling git read-tree the following: The current index and work tree is derived from $H, but\nthe user may have local changes in them since $H. The user wants to fast-forward to $M. In this case, the git read-tree -m $H $M command makes sure\nthat no local change is lost as the result of this \"merge\".\nHere are the \"carry forward\" rules, where \"I\" denotes the index,\n\"clean\" means that index and work tree coincide, and \"exists\"/\"nothing\"\nrefer to the presence of a path in the specified commit: I H M Result\n -------------------------------------------------------\n 0 nothing nothing nothing (does not happen)\n 1 nothing nothing exists use M\n 2 nothing exists nothing remove path from index\n 3 nothing exists exists, use M if \"initial checkout\",\n\t\t\t\t H == M keep index otherwise\n\t\t\t\t exists, fail\n\t\t\t\t H != M\n\n clean I==H I==M\n ------------------\n 4 yes N/A N/A nothing nothing keep index\n 5 no N/A N/A nothing nothing keep index\n\n 6 yes N/A yes nothing exists keep index\n 7 no N/A yes nothing exists keep index\n 8 yes N/A no nothing exists fail\n 9 no N/A no nothing exists fail\n\n 10 yes yes N/A exists nothing remove path from index\n 11 no yes N/A exists nothing fail\n 12 yes no N/A exists nothing fail\n 13 no no N/A exists nothing fail\n\n\tclean (H==M)\n ------\n 14 yes exists exists keep index\n 15 no exists exists keep index\n\n clean I==H I==M (H!=M)\n ------------------\n 16 yes no no exists exists fail\n 17 no no no exists exists fail\n 18 yes no yes exists exists keep index\n 19 no no yes exists exists keep index\n 20 yes yes no exists exists use M\n 21 no yes no exists exists fail In all \"keep index\" cases, the index entry stays as in the\noriginal index file. If the entry is not up to date, git read-tree keeps the copy in the work tree intact when\noperating under the -u flag. When this form of git read-tree returns successfully, you can\nsee which of the \"local changes\" that you made were carried forward by running git diff-index --cached $M . Note that this does not\nnecessarily match what git diff-index --cached $H would have\nproduced before such a two tree merge. This is because of cases\n18 and 19 — if you already had the changes in $M (e.g. maybe\nyou picked it up via e-mail in a patch form), git diff-index\n--cached $H would have told you about the change before this\nmerge, but it would not show in git diff-index --cached $M output after the two-tree merge. Case 3 is slightly tricky and needs explanation. The result from this\nrule logically should be to remove the path if the user staged the removal\nof the path and then switching to a new branch. That however will prevent\nthe initial checkout from happening, so the rule is modified to use M (new\ntree) only when the content of the index is empty. Otherwise the removal\nof the path is kept as long as $H and $M are the same. 3-Way Merge Each \"index\" entry has two bits worth of \"stage\" state. stage 0 is the\nnormal one, and is the only one you’d see in any kind of normal use. However, when you do git read-tree with three trees, the \"stage\"\nstarts out at 1. This means that you can do $ git read-tree -m <tree1> <tree2> <tree3> and you will end up with an index with all of the <tree1> entries in\n\"stage1\", all of the <tree2> entries in \"stage2\" and all of the\n<tree3> entries in \"stage3\". When performing a merge of another\nbranch into the current branch, we use the common ancestor tree\nas <tree1>, the current branch head as <tree2>, and the other\nbranch head as <tree3>. Furthermore, git read-tree has special-case logic that says: if you see\na file that matches in all respects in the following states, it\n\"collapses\" back to \"stage0\": stage 2 and 3 are the same; take one or the other (it makes no\ndifference - the same work has been done on our branch in\nstage 2 and their branch in stage 3) stage 1 and stage 2 are the same and stage 3 is different; take\nstage 3 (our branch in stage 2 did not do anything since the\nancestor in stage 1 while their branch in stage 3 worked on\nit) stage 1 and stage 3 are the same and stage 2 is different take\nstage 2 (we did something while they did nothing) The git write-tree command refuses to write a nonsensical tree, and it\nwill complain about unmerged entries if it sees a single entry that is not\nstage 0. OK, this all sounds like a collection of totally nonsensical rules,\nbut it’s actually exactly what you want in order to do a fast\nmerge. The different stages represent the \"result tree\" (stage 0, aka\n\"merged\"), the original tree (stage 1, aka \"orig\"), and the two trees\nyou are trying to merge (stage 2 and 3 respectively). The order of stages 1, 2 and 3 (hence the order of three\n<tree-ish> command-line arguments) are significant when you\nstart a 3-way merge with an index file that is already\npopulated. Here is an outline of how the algorithm works: if a file exists in identical format in all three trees, it will\nautomatically collapse to \"merged\" state by git read-tree . a file that has any difference what-so-ever in the three trees\nwill stay as separate entries in the index. It’s up to \"porcelain\npolicy\" to determine how to remove the non-0 stages, and insert a\nmerged version. the index file saves and restores with all this information, so you\ncan merge things incrementally, but as long as it has entries in\nstages 1/2/3 (i.e., \"unmerged entries\") you can’t write the result. So\nnow the merge algorithm ends up being really simple: you walk the index in order, and ignore all entries of stage 0,\nsince they’ve already been done. if you find a \"stage1\", but no matching \"stage2\" or \"stage3\", you\nknow it’s been removed from both trees (it only existed in the\noriginal tree), and you remove that entry. if you find a matching \"stage2\" and \"stage3\" tree, you remove one\nof them, and turn the other into a \"stage0\" entry. Remove any\nmatching \"stage1\" entry if it exists too. .. all the normal\ntrivial rules .. You would normally use git merge-index with supplied git merge-one-file to do this last step. The script updates\nthe files in the working tree as it merges each path and at the\nend of a successful merge. When you start a 3-way merge with an index file that is already\npopulated, it is assumed that it represents the state of the\nfiles in your work tree, and you can even have files with\nchanges unrecorded in the index file. It is further assumed\nthat this state is \"derived\" from the stage 2 tree. The 3-way\nmerge refuses to run if it finds an entry in the original index\nfile that does not match stage 2. This is done to prevent you from losing your work-in-progress\nchanges, and mixing your random changes in an unrelated merge\ncommit. To illustrate, suppose you start from what has been\ncommitted last to your repository: $ JC=`git rev-parse --verify \"HEAD^0\"`\n$ git checkout-index -f -u -a $JC You do random edits, without running git update-index . And then\nyou notice that the tip of your \"upstream\" tree has advanced\nsince you pulled from him: $ git fetch git://.... linus\n$ LT=`git rev-parse FETCH_HEAD` Your work tree is still based on your HEAD ($JC), but you have\nsome edits since. Three-way merge makes sure that you have not\nadded or modified index entries since $JC, and if you haven’t,\nthen does the right thing. So with the following sequence: $ git read-tree -m -u `git merge-base $JC $LT` $JC $LT\n$ git merge-index git-merge-one-file -a\n$ echo \"Merge with Linus\" | \\\n git commit-tree `git write-tree` -p $JC -p $LT what you would commit is a pure merge between $JC and $LT without\nyour work-in-progress changes, and your work tree would be\nupdated to the result of the merge. However, if you have local changes in the working tree that\nwould be overwritten by this merge, git read-tree will refuse\nto run to prevent your changes from being lost. In other words, there is no need to worry about what exists only\nin the working tree. When you have local changes in a part of\nthe project that is not involved in the merge, your changes do\nnot interfere with the merge, and are kept intact. When they do interfere, the merge does not even start ( git read-tree complains loudly and fails without modifying anything). In such\na case, you can simply continue doing what you were in the\nmiddle of doing, and when your working tree is ready (i.e. you\nhave finished your work-in-progress), attempt the merge again."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "PostgreSQL: background worker \"logical replication launcher\" exited with exit code 1\n\nUsing our own instance of Gitlab we get the error background worker \"logical replication launcher\" exited with exit code 1 when trying to use the postgres service in our runners. Haven't found anything useful over the internet. Any idea what's going on? \nVersions:\n\nGitlab 12.4.3\ngitlab-runner 12.5.0 (limit of 4 concurrent jobs)\npostgres 12.1 (tried with 11 and same result)\nDigitalOcean droplet: CPU-Optimized / 8 GB / 4 vCPUs \n\nRelevant part in gitlab-ci.yml:\nimage: golang:1.12\n\nservices:\n - postgres\n\nvariables:\n POSTGRES_USER: postgres\n POSTGRES_DB: xproject_test\n POSTGRES_PASSWORD: postgres\n\nFailure log:\nRunning with gitlab-runner 12.5.0 (577f813d)\n on xproject sEZeszwx\nUsing Docker executor with image xproject-ci ...\nStarting service postgres:latest ...\nPulling docker image postgres:latest ...\nUsing docker image sha256:9eb7b0ce936d2eac8150df3de7496067d56bf4c1957404525fd60c3640dfd450 for postgres:latest ...\nWaiting for services to be up and running...\n\n*** WARNING: Service runner-sEZeszwx-project-18-concurrent-0-postgres-0 probably didn't start properly.\n\nHealth check error:\nservice \"runner-sEZeszwx-project-18-concurrent-0-postgres-0-wait-for-service\" timeout\n\nHealth check container logs:\n\n\nService container logs:\n2019-11-20T10:16:23.805738908Z The files belonging to this database system will be owned by user \"postgres\".\n2019-11-20T10:16:23.805807212Z This user must also own the server process.\n2019-11-20T10:16:23.805818432Z \n2019-11-20T10:16:23.806094094Z The database cluster will be initialized with locale \"en_US.utf8\".\n2019-11-20T10:16:23.806120707Z The default database encoding has accordingly been set to \"UTF8\".\n2019-11-20T10:16:23.806208494Z The default text search configuration will be set to \"english\".\n2019-11-20T10:16:23.806264704Z \n2019-11-20T10:16:23.806282587Z Data page checksums are disabled.\n2019-11-20T10:16:23.806586302Z \n2019-11-20T10:16:23.806931287Z fixing permissions on existing directory /var/lib/postgresql/data ... ok\n2019-11-20T10:16:23.807763042Z creating subdirectories ... ok\n2019-11-20T10:16:23.808045789Z selecting dynamic shared memory implementation ... posix\n2019-11-20T10:16:23.835644353Z selecting default max_connections ... 100\n2019-11-20T10:16:23.866604734Z selecting default shared_buffers ... 128MB\n2019-11-20T10:16:23.928432088Z selecting default time zone ... Etc/UTC\n2019-11-20T10:16:23.929447992Z creating configuration files ... ok\n2019-11-20T10:16:24.122662589Z running bootstrap script ... ok\n2019-11-20T10:16:24.706975030Z performing post-bootstrap initialization ... ok\n2019-11-20T10:16:24.819117668Z initdb: warning: enabling \"trust\" authentication for local connections\n2019-11-20T10:16:24.819150100Z You can change this by editing pg_hba.conf or using the option -A, or\n2019-11-20T10:16:24.819157763Z --auth-local and --auth-host, the next time you run initdb.\n2019-11-20T10:16:24.819272849Z syncing data to disk ... ok\n2019-11-20T10:16:24.819313390Z \n2019-11-20T10:16:24.819328954Z \n2019-11-20T10:16:24.819340787Z Success. You can now start the database server using:\n2019-11-20T10:16:24.819349374Z \n2019-11-20T10:16:24.819357407Z pg_ctl -D /var/lib/postgresql/data -l logfile start\n2019-11-20T10:16:24.819365840Z \n2019-11-20T10:16:24.857656160Z waiting for server to start....2019-11-20 10:16:24.857 UTC [46] LOG: starting PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit\n2019-11-20T10:16:24.860371378Z 2019-11-20 10:16:24.860 UTC [46] LOG: listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\n2019-11-20T10:16:24.886271885Z 2019-11-20 10:16:24.886 UTC [47] LOG: database system was shut down at 2019-11-20 10:16:24 UTC\n2019-11-20T10:16:24.892844968Z 2019-11-20 10:16:24.892 UTC [46] LOG: database system is ready to accept connections\n2019-11-20T10:16:24.943542403Z done\n2019-11-20T10:16:24.943591286Z server started\n2019-11-20T10:16:25.084670051Z CREATE DATABASE\n2019-11-20T10:16:25.086153670Z \n2019-11-20T10:16:25.086604000Z \n2019-11-20T10:16:25.086694058Z /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*\n2019-11-20T10:16:25.086711933Z \n2019-11-20T10:16:25.088473308Z 2019-11-20 10:16:25.088 UTC [46] LOG: received fast shutdown request\n2019-11-20T10:16:25.090893184Z waiting for server to shut down....2019-11-20 10:16:25.090 UTC [46] LOG: aborting any active transactions\n2019-11-20T10:16:25.092499368Z 2019-11-20 10:16:25.092 UTC [46] LOG: background worker \"logical replication launcher\" (PID 53) exited with exit code 1\n2019-11-20T10:16:25.093942785Z 2019-11-20 10:16:25.093 UTC [48] LOG: shutting down\n2019-11-20T10:16:25.112341160Z 2019-11-20 10:16:25.112 UTC [46] LOG: database system is shut down\n2019-11-20T10:16:25.189351710Z done\n2019-11-20T10:16:25.189393803Z server stopped\n2019-11-20T10:16:25.189929555Z \n2019-11-20T10:16:25.189967760Z PostgreSQL init process complete; ready for start up.\n2019-11-20T10:16:25.189982340Z \n2019-11-20T10:16:25.214046388Z 2019-11-20 10:16:25.213 UTC [1] LOG: starting PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit\n2019-11-20T10:16:25.214092434Z 2019-11-20 10:16:25.213 UTC [1] LOG: listening on IPv4 address \"0.0.0.0\", port 5432\n2019-11-20T10:16:25.214172706Z 2019-11-20 10:16:25.214 UTC [1] LOG: listening on IPv6 address \"::\", port 5432\n2019-11-20T10:16:25.219769380Z 2019-11-20 10:16:25.219 UTC [1] LOG: listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\n2019-11-20T10:16:25.241614800Z 2019-11-20 10:16:25.241 UTC [64] LOG: database system was shut down at 2019-11-20 10:16:25 UTC\n2019-11-20T10:16:25.248887712Z 2019-11-20 10:16:25.248 UTC [1] LOG: database system is ready to accept connections\n\n*********"
},
{
"role": "assistant",
"content": "First thing, your Database container is ready to accept the connection, as you can see from the logs\n2019-11-20T10:16:25.248887712Z 2019-11-20 10:16:25.248 UTC [1] LOG: database system is ready to accept connections\n\nThis is the expected behaviour of the offical Postgres image If you look into the entrypoint of Postgres it performs two tasks.\n\nit will run any *.sql files, run any executable *.sh scripts, and source any non-executable *.sh scripts found in that directory to do further initialization before starting the service from this directory /docker-entrypoint-initdb.d\nafter initialization completion, it stops the process and runs it again as the main process of the container.\n\n\ndo you know why I get that shutdown request?\n\n# stop postgresql server after done setting up user and running scripts\ndocker_temp_server_stop() {\n PGUSER=\"${PGUSER:-postgres}\" \\\n pg_ctl -D \"$PGDATA\" -m fast -w stop\n}\n\nthen after completion\n.\n.\n\n echo 'PostgreSQL init process complete; ready for start up.'\n\n.\n.\nexec \"$@\""
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I make git-svn use a particular svn branch as the remote repository?\nA word of warning: I'm a n00b to git in general. My team uses feature branches in svn, and I'd like to use git-svn to track my work on a particular feature branch. I've been (roughly) following Andy Delcambre's post to set up my local git repo, but those instructions seem to have led git to pick the svn branch that had changed most recently as the remote repository; the problem is that's not the branch I care about. How do I control which branch git-svn uses? Or am I approaching this completely wrong?\nUPDATE: I did use the -T, -b, and -t options (in my case because the svn repo has multiple projects, but I want the git repo to contain only the project I'm working on)."
},
{
"role": "assistant",
"content": "Muchas gracias to Bart's Blog for this handy reference for svn branches in git. Apparently all I needed was to specify a remote branch when creating the git branch, e.g., \ngit checkout -b git-topic-branch-foo foo\n\nwhere foo is the name of the remote branch."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Amend username for a pushed commit on Github\n\nI made a push to a newly forked git repo on Github but after committing i noticed that my username was incorrect. The username I pushed was \"Brock Woolf\" but it should have been brockwoolf which is my username on github.\nI already changed the default locally like this:\ngit config --global user.name \"brockwoolf\"\n\nBut how can I change the username on the already pushed change?"
},
{
"role": "assistant",
"content": "The already pushed change, if people have pulled it, is something you'll have to live with. If no one's pulled it (i.e. you realize your mistake right after pushing), you can amend your commit:\ngit commit --amend\n\nMake sure you don't add any new changes to the commit - don't use -a, don't use git add first. Then you can force the push, since this is a non-fast-forward change:\ngit push -f\n\nIf anyone's already pulled the commit with the incorrect name... this probably won't actually mess them up, since merging it with something containing the original commit should be easy; the patches are the same. However, if that person ever pushed back to your repo, they'd push that merge - along with the original commit on one side of it. Kind of defeats the purpose of renaming yourself if you end up with both names in the repo. (This is exactly the problem I described in my comment on the OP's answer.)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options mailinfo.scissors"
},
{
"role": "assistant",
"content": "If true, makes git-mailinfo (and therefore git-am ) act by default as if the --scissors option\nwas provided on the command-line. When active, this feature\nremoves everything from the message body before a scissors\nline (i.e. consisting mainly of \">8\", \"8<\" and \"-\")."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-update-index - Register file contents in the working tree to the index"
},
{
"role": "assistant",
"content": "USING “ASSUME UNCHANGED” BIT Many operations in Git depend on your filesystem to have an\nefficient lstat(2) implementation, so that st_mtime information for working tree files can be cheaply checked to see\nif the file contents have changed from the version recorded in\nthe index file. Unfortunately, some filesystems have\ninefficient lstat(2) . If your filesystem is one of them, you\ncan set \"assume unchanged\" bit to paths you have not changed to\ncause Git not to do this check. Note that setting this bit on a\npath does not mean Git will check the contents of the file to\nsee if it has changed — it makes Git to omit any checking and\nassume it has not changed. When you make changes to working\ntree files, you have to explicitly tell Git about it by dropping\n\"assume unchanged\" bit, either before or after you modify them. In order to set \"assume unchanged\" bit, use --assume-unchanged option. To unset, use --no-assume-unchanged . To see which files\nhave the \"assume unchanged\" bit set, use git ls-files -v (see git-ls-files ). The command looks at core.ignorestat configuration variable. When\nthis is true, paths updated with git update-index paths... and\npaths updated with other Git commands that update both index and\nworking tree (e.g. git apply --index , git checkout-index -u ,\nand git read-tree -u ) are automatically marked as \"assume\nunchanged\". Note that \"assume unchanged\" bit is not set if git update-index --refresh finds the working tree file matches\nthe index (use git update-index --really-refresh if you want\nto mark them as \"assume unchanged\"). Sometimes users confuse the assume-unchanged bit with the\nskip-worktree bit. See the final paragraph in the \"Skip-worktree bit\"\nsection below for an explanation of the differences."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-format-patch - Prepare patches for e-mail submission --ignore-if-in-upstream"
},
{
"role": "assistant",
"content": "Do not include a patch that matches a commit in\n<until>..<since>. This will examine all patches reachable\nfrom <since> but not from <until> and compare them with the\npatches being generated, and any patch that matches is\nignored."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker GIT_TRACE_PERFORMANCE"
},
{
"role": "assistant",
"content": "Enables performance related trace messages, e.g. total execution\ntime of each Git command.\nSee GIT_TRACE for available trace output options."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options imap.port"
},
{
"role": "assistant",
"content": "An integer port number to connect to on the server.\nDefaults to 143 for imap:// hosts and 993 for imaps:// hosts.\nIgnored when imap.tunnel is set."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-mailsplit"
},
{
"role": "assistant",
"content": "Simple UNIX mbox splitter program"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fsck - Verifies the connectivity and validity of the objects in the database fullPathname"
},
{
"role": "assistant",
"content": "(WARN) A path contains the full path starting with \"/\"."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to track untracked content?\nSee below the solid line for my original question.\nI have a folder in my local directory that is untracked. When I run git status, I get:\nChanged but not updated:\nmodified: vendor/plugins/open_flash_chart_2 (modified content, untracked content)\n\nWhen I type git add vendor/plugins/open_flash_chart_2 then try git status again, it still says untracked. What's going on? \n\nHere is a simple summary of my latest half hour:\n\nDiscovered that my Github repo is not tracking my vendor/plugins/open_flash_chart_2 plugin. Specifically, there's no content and it's showing a green arrow on the folder icon.\nTried git submodule init\nNo submodule mapping found in .gitmodules for path 'vendor/plugins/open_flash_chart_2'\n\nTried git submodule add git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2\nvendor/plugins/open_flash_chart_2 already exists in the index\n\ngit status \nmodified: vendor/plugins/open_flash_chart_2 (untracked content)\n\nHunted for any file named .gitmodules in my repository/local directory but couldn't find one.\n\nWhat do I have to do to get my submodules working so git can start tracking properly?\n\nThis may be unrelated (I include it in case it helps), but every time I type git commit -a rather than my usual git commit -m \"my comments\", it throws up an error:\nE325: ATTENTION\nFound a swap file by the name \".git\\.COMMIT-EDITMSG.swp\"\n dated: Thu Nov 11 19:45:05 2010\n file name: c:/san/project/.git/COMMIT_EDITMSG\n modified: YES\n user name: San host name: San-PC\n process ID: 4268\nWhile opening file \".git\\COMMIT_EDITMSG\"\n dated: Thu Nov 11 20:56:09 2010\n NEWER than swap file! \nSwap file \".git\\.COMMIT_EDITMSG.swp\" already exists!\n[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:\nSwap file \".git\\.COMMIT_EDITMSG.swp\" already exists!\n[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:\n\nI am a complete newbie at Github and despite trying to go through the documentation, I'm a bit stumped by these particular problems. Thank you."
},
{
"role": "assistant",
"content": "You have added vendor/plugins/open_flash_chart_2 as “gitlink” entry, but never defined it as a submodule. Effectively you are using the internal feature that git submodule uses (gitlink entries) but you are not using the submodule feature itself.\nYou probably did something like this:\ngit clone git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2\ngit add vendor/plugins/open_flash_chart_2\n\nThis last command is the problem. The directory vendor/plugins/open_flash_chart_2 starts out as an independent Git repository. Usually such sub-repositories are ignored, but if you tell git add to explicitly add it, then it will create an gitlink entry that points to the sub-repository’s HEAD commit instead of adding the contents of the directory. It might be nice if git add would refuse to create such “semi-submodules”.\nNormal directories are represented as tree objects in Git; tree objects give names, and permissions to the objects they contain (usually other tree and blob objects—directories and files, respectively). Submodules are represented as “gitlink” entries; gitlink entries only contain the object name (hash) of the HEAD commit of the submodule. The “source repository” for a gitlink’s commit is specified in the .gitmodules file (and the .git/config file once the submodule has been initialized).\nWhat you have is an entry that points to a particular commit, without recording the source repository for that commit. You can fix this by either making your gitlink into a proper submodule, or by removing the gitlink and replacing it with “normal” content (plain files and directories).\nTurn It into a Proper Submodule\nThe only bit you are missing to properly define vendor/plugins/open_flash_chart_2 as a submodule is a .gitmodules file. Normally (if you had not already added it as bare gitlink entry), you would just use git submodule add:\ngit submodule add git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2\n\nAs you found, this will not work if the path already exists in the index. The solution is to temporarily remove the gitlink entry from the index and then add the submodule:\ngit rm --cached vendor/plugins/open_flash_chart_2\ngit submodule add git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2\n\nThis will use your existing sub-repository (i.e. it will not re-clone the source repository) and stage a .gitmodules file that looks like this:\n[submodule \"vendor/plugins/open_flash_chart_2\"]\n path = vendor/plugins/open_flash_chart_2\n url = git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2\n\nIt will also make a similar entry in your main repository’s .git/config (without the path setting).\nCommit that and you will have a proper submodule. When you clone the repository (or push to GitHub and clone from there), you should be able to re-initialize the submodule via git submodule update --init.\nReplace It with Plain Content\nThe next step assumes that your sub-repository in vendor/plugins/open_flash_chart_2 does not have any local history that you want to preserve (i.e. all you care about is the current working tree of the sub-repository, not the history).\nIf you have local history in the sub-repository that you care about, then you should backup the sub-repository’s .git directory before deleting it in the second command below. (Also consider the git subtree example below that preserves the history of the sub-repository’s HEAD).\ngit rm --cached vendor/plugins/open_flash_chart_2\nrm -rf vendor/plugins/open_flash_chart_2/.git # BACK THIS UP FIRST unless you are sure you have no local changes in it\ngit add vendor/plugins/open_flash_chart_2\n\nThis time when adding the directory, it is not a sub-repository, so the files will be added normally. Unfortunately, since we deleted the .git directory there is no super-easy way to keep things up-to-date with the source repository.\nYou might consider using a subtree merge instead. Doing so will let you easily pull in changes from the source repository while keeping the files “flat” in your repository (no submodules). The third-party git subtree command is a nice wrapper around the subtree merge functionality.\ngit rm --cached vendor/plugins/open_flash_chart_2\ngit commit -m'converting to subtree; please stand by'\nmv vendor/plugins/open_flash_chart_2 ../ofc2.local\ngit subtree add --prefix=vendor/plugins/open_flash_chart_2 ../ofc2.local HEAD\n#rm -rf ../ofc2.local # if HEAD was the only tip with local history\n\nLater:\ngit remote add ofc2 git://github.com/korin/open_flash_chart_2_plugin.git\ngit subtree pull --prefix=vendor/plugins/open_flash_chart_2 ofc2 master\n\ngit subtree push --prefix=vendor/plugins/open_flash_chart_2 [email protected]:me/my_ofc2_fork.git changes_for_pull_request\n\ngit subtree also has a --squash option that lets you avoid incorporating the source repository’s history into your history but still lets you pull in upstream changes."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Specify an SSH key for git push for a given domain\nI have the following use case: I would like to be able to push to [email protected]:gitolite-admin using the private key of user gitolite-admin, while I want to push to [email protected]:some_repo using 'my own' private key. AFAIK, I can't solve this using ~/.ssh/config, because the user name and server name are identical in both cases. As I mostly use my own private key, I have that defined in ~/.ssh/config for [email protected]. Does anyone know of a way to override the key that is used for a single git invocation?\n(Aside: gitolite distinguishes who is doing the pushing based on the key, so it's not a problem, in terms of access, ownership and auditing, that the user@server string is identical for different users.)"
},
{
"role": "assistant",
"content": "Even if the user and host are the same, they can still be distinguished in ~/.ssh/config. For example, if your configuration looks like this:\nHost gitolite-as-alice\n HostName git.company.com\n User git\n IdentityFile /home/whoever/.ssh/id_rsa.alice\n IdentitiesOnly yes\n\nHost gitolite-as-bob\n HostName git.company.com\n User git\n IdentityFile /home/whoever/.ssh/id_dsa.bob\n IdentitiesOnly yes\n\nThen you just use gitolite-as-alice and gitolite-as-bob instead of the hostname in your URL:\ngit remote add alice git@gitolite-as-alice:whatever.git\ngit remote add bob git@gitolite-as-bob:whatever.git\n\nNote\nYou want to include the option IdentitiesOnly yes to prevent the use of default ids. Otherwise, if you also have id files matching the default names, they will get tried first because unlike other config options (which abide by \"first in wins\") the IdentityFile option appends to the list of identities to try. See: https://serverfault.com/questions/450796/how-could-i-stop-ssh-offering-a-wrong-key/450807#450807"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options sendemail.aliasesFile"
},
{
"role": "assistant",
"content": "To avoid typing long email addresses, point this to one or more\nemail aliases files. You must also supply sendemail.aliasFileType ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-hook"
},
{
"role": "assistant",
"content": "Run git hooks"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git issue with Visual Studio 2015\nI have a Visual Studio solution inside a git repository created with TortoiseGit version 1.8.16.0 (git version 2.6.2.windows.1)\nI just updated Visual Studio from 2015 to 2015 Update 1, and it stopped tracking changes on my files. also it won't allow me to commit anything.\nIs this some sort of a known problem? are there any solutions?\n\nupdate\n(ironic title...) \nVS tracks unsaved files as \"changed\"\nand saved files appear to be \"unchanged\"\nswitching branches is behaves correctly and results in an error if there are uncommitted (real )changes\n\nupdate 2\ncould this in the output window could have anything to do with the error:\nOpening repositories:\nCould not open 'C:/[project path].VC.opendb': The process cannot access the file because it is being used by another process.\nCould not open 'C:/[project path].VC.opendb': The process cannot access the file because it is being used by another process."
},
{
"role": "assistant",
"content": "I had the exact same issue as you and spent hours trying to get it to work, including re-cloning.\nI solved it on my end by adding the *.VC.opendb and *.VC.db files to the .gitignore file of my project.\nAs soon as I returned to Visual Studio all my pending changes were showing. As far as I can tell it's all working normally again."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to get my own GitHub events payload json for testing GitHub Actions locally?\n\nI use GitHub Actions and want to test it locally.\nI'm using this tool and it works fine.\nhttps://github.com/nektos/act\nI can provide a event.json for local testing, but it's really hard to create a real event payload.\nIs there any way to get real event payload?\nFor example, I create pull request on my repository from the console, and get that event payload json."
},
{
"role": "assistant",
"content": "To get event data, you can use a GitHub action to print the event to the log.\n# change this to the event type you want to get the data for\non:\n pull_request:\n types: [opened, closed, reopened]\n\njobs:\n printJob: \n name: Print event\n runs-on: ubuntu-latest\n steps:\n - name: Dump GitHub context\n env:\n GITHUB_CONTEXT: ${{ toJson(github) }}\n run: |\n echo \"$GITHUB_CONTEXT\"\n\nAlternatively, you can find example event data in the documentation:\nhttps://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#webhook-payload-example-30"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Connecting to GitLab repositories on Android Studio\nI'm trying to connect to a GitLab repository using the I/O preview of Android Studio. Does anyone know how to do this/if it is possible yet?"
},
{
"role": "assistant",
"content": "How to add an Android Studio project to GitLab\nThis answer shows how to do it using the Android Studio GUI.\n1. Create a new project on GitLab\nChose the + button on the menu bar. Add a project name and then click \"Create project\".\n\nThis will give you a new project address. Choose the https version.\n\nIt will look something like this:\nhttps://gitlab.com/MyUserName/my-project.git\n\n2. Create a Git repository in Android Studio\nIn the Android Studio menu go to VCS > Import into Version Control > Create Git Repository...\n\nSelect the root directory of your project. (It will be automatically selected if you already have it highlighted in the Project view. Otherwise you will have to browse up to find it.)\n3. Add remote\nGo to VCS > Git > Remotes.... Then paste in the https address you got from GitLab in step one.\n\nYou may need to log in with your GitLab username and password.\n4. Add, commit, and push your files\nMake sure you have the top level of the project selected. If you are in the Android view you can switch it to the Project view.\n\n\nAdd: Go to VCS > Git > Add.\nCommit: After adding, do VCS > Git > Commit Directory. (You will need to write a commit message, something like initial commit.)\nPush: Finally, go to VCS > Git > Push.\n\nFinished!\nYou should be able to view your files in GitLab now.\nSee also\nThere is a plugin that would probably streamline the process. Check it out here."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options fsmonitor.socketDir"
},
{
"role": "assistant",
"content": "This Mac OS-specific option, if set, specifies the directory in\nwhich to create the Unix domain socket used for communication\nbetween the fsmonitor daemon and various Git commands. The directory must\nreside on a native Mac OS filesystem. Only respected when core.fsmonitor is set to true ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-merge - Join two or more development histories together rename-threshold=<n>"
},
{
"role": "assistant",
"content": "Deprecated synonym for find-renames=<n> ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab Style Network Graphs on Github\n\nOne of the things i really liked on Gitlab was their network graphs\nIs there a way to get a similar look/feel in Github? \nI find the gitlab version much easier to work with"
},
{
"role": "assistant",
"content": "We've just moved our client work from a self-hosted GitLab instance to private GitHub repositories and I feel the same pain - I live on the GitLab network graph page!\nSo I've gone ahead and got it working for any local repository. That's not quite GitHub of course, but you can locally clone any GitHub project to use it.\nThe code and instructions are at https://github.com/chromatixau/gitlab-network-graph. It's not perfect yet - there are issues with getting the right 'space' allocation on the graph for some merge strategies, but it works for most simpler situations. I'm continuing to work on it.\nThe steps were basically to copy the network related frontend JS files from the MIT-licensed GitLab CE repository, build a small webpack config based on GitLab's, and then put together some scripts to create the JSON that GitLab builds the graph from (I've used a shell script to basically run git log and format it as JSON, and then a Node.js script to further massage that JSON)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitglossary - A Git Glossary clean"
},
{
"role": "assistant",
"content": "A working tree is clean, if it\ncorresponds to the revision referenced by the current head . Also see \" dirty \"."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to combine multiple stashes in git\nThis is a pipeline on branch frontend over the last two weeks.\n| Stash@{3} is all code since Stash@{1} (excluding the two tiny commits)\n| Tiny Commit\n| Tiny commit\n| Huge bulk commit two weeks ago, now rebased and moved to Stash@{1} \nMy working tree is currently clean.\nStash@{1} is the contents from a bulk commit of general development code two weeks ago (this should have been stashed in the first place). This commit was undone and moved to stash.\nStash@{3} is the newest work on that tree since Stash@{1} (minus a couple of changes that have been committed). \nI need to combine these two stashes together in my working tree so I can make a number of commits from this huge pool of work.\nI ran git stash apply stash@{1} then I tried:\ngit stash apply stash@{3}\ngit stash show -p | git stash apply stash@{3}\nbut I get 'dirty working tree' in both cases. How can I merge this work together? Because stash@{3} is newer, I want it to supersede stash@{1} wherever there are conflicts."
},
{
"role": "assistant",
"content": "It's a little involved, but this almost always works:\n\nPop the first stash\n$ git stash pop\n\nTemporarily commit the changes from the first stash\n$ git add . && git commit -am 'WIP'\n\nPop the second stash\n$ git stash pop\n\nUndo the temporary commit, keeping the changes it introduced\n$ git reset --soft HEAD^"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Pull request vs Merge request\n\nWhat is the difference between a Pull request and a Merge request?\nIn GitHub, it's a Pull Request while in GitLab, for example, it's a Merge Request. So, is there a difference between both of these?"
},
{
"role": "assistant",
"content": "GitLab's \"merge request\" feature is equivalent to GitHub's \"pull request\" feature. Both are means of pulling changes from another branch or fork into your branch and merging the changes with your existing code. They are useful tools for code review and change management.\nAn article from GitLab discusses the differences in naming the feature:\n\nMerge or pull requests are created in a git management application and ask an assigned person to merge two branches. Tools such as GitHub and Bitbucket choose the name pull request since the first manual action would be to pull the feature branch. Tools such as GitLab and Gitorious choose the name merge request since that is the final action that is requested of the assignee. In this article we'll refer to them as merge requests.\n\nA \"merge request\" should not be confused with the git merge command. Neither should a \"pull request\" be confused with the git pull command. Both git commands are used behind the scenes in both pull requests and merge requests, but a merge/pull request refers to a much broader topic than just these two commands."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to clone all projects of a group at once in GitLab?\n\nIn my GitLab repository, I have a group with 20 projects. I want to clone all projects at once. Is that possible?"
},
{
"role": "assistant",
"content": "Update Dec. 2022, use glab repo clone\nglab repo clone -g <group> -a=false -p --paginate\n\nWith:\n\n-p, --preserve-namespace: Clone the repo in a subdirectory based on namespace\n--paginate: Make additional HTTP requests to fetch all pages of projects before cloning. Respects --per-page\n-a, --archived: Limit by archived status. Use with -a=false to exclude archived repositories. Used with --group flag\n\nThat does support cloning more than 100 repositories (since MR 1030, and glab v1.24.0, Dec. 2022)\nThis is for gitlab.com or for a self-managed GitLab instance, provided you set the environment variable GITLAB_URI or GITLAB_HOST: it specifies the URL of the GitLab server if self-managed (eg: https://gitlab.example.com).\n\nOriginal answer and updates (starting March 2015):\nNot really, unless:\n\nyou have a 21st project which references the other 20 as submodules.\n(in which case a clone followed by a git submodule update --init would be enough to get all 20 projects cloned and checked out)\n\nor you somehow list the projects you have access (GitLab API for projects), and loop on that result to clone each one (meaning that can be scripted, and then executed as \"one\" command)\n\n\n\nSince 2015, Jay Gabez mentions in the comments (August 2019) the tool gabrie30/ghorg\n\nghorg allows you to quickly clone all of an org's or user's repos into a single directory.\n\nUsage:\n$ ghorg clone someorg\n$ ghorg clone someuser --clone-type=user --protocol=ssh --branch=develop\n$ ghorg clone gitlab-org --scm=gitlab --namespace=gitlab-org/security-products\n$ ghorg clone --help\n\n\nAlso (2020): https://github.com/ezbz/gitlabber\nusage: gitlabber [-h] [-t token] [-u url] [--debug] [-p]\n [--print-format {json,yaml,tree}] [-i csv] [-x csv]\n [--version]\n [dest]\n\nGitlabber - clones or pulls entire groups/projects tree from gitlab"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to unlink / sign out from Git repository in \"Visual Studio Code\" for Mac\nBeen playing around with this Microsoft Editor. Quite good, but some of the most basic UI bits are missing.\nCan't figure out how to unlink / sign out from the Git repo I signed in before.\nQuitting and reopening the software doesn't work and - useless to say - I have many repo I work with.\nAny idea?"
},
{
"role": "assistant",
"content": "On the bottom of the side panel, there is an account icon (usually its sitting right above the cog icon).\n\nClick on it, click on your user name, and choose \"log out\"."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Adding to someone else’s pull request on a GitHub project that I do not own\nIs it possible for me to add commits to someone else’s pull request on a repository where I am not the owner?\ne.g.\nUser A owns Project X.\nUser B forks Project X, creates a feature branch, makes some changes, and submits a pull request.\nUser C likes the pull request, but would like to make some modifications to it. (FWIW User C already has a fork of Project X, so is unable to easily fork User B’s fork).\nCan User C add commits to User B’s PR?"
},
{
"role": "assistant",
"content": "You can check out the branch and re-submit a modified PR (giving credit to the original, preferably).\nYou can also issue a PR to the PR author:\ngit remote add userb https://github.com/userb/name.git\ngit fetch userb\ngit checkout featurebranch\n[change and commit]\ngit push userc featurebranch\n\nWhen you create a PR, GitHub lets you choose the base branch - so you can choose the fork and - if you want to - request changes to the PR."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "stash@{1} is ambiguous?\nI'm trying to get info about my stash, but git is telling me that stash@{0} and stash@{1} are ambiguous. git stash list works fine, and .git/logs/refs/stash seems to have the appropriate content (not that I'm an expert on git internals).\n% git stash list\nstash@{0}: On master: two\nstash@{1}: On master: one\n% git stash show stash@{1}\nfatal: ambiguous argument 'stash@1': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\n\nJust plain git stash show works fine. So why are the names that git stash list gives me considered ambiguous?"
},
{
"role": "assistant",
"content": "Your shell is eating your curly brackets, so while you say stash@{1}, git sees stash@1, and that makes no sense to it. Quote the argument (use git stash apply \"stash@{1}\" or git stash apply stash@\"{1}\"; quoting either way will work) or reconfigure your shell to only expand curly brackets when there is a comma between them (zsh can be configured either way; bash only expands curly brackets with a comma or range between them while other shells may behave differently)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-daemon - A really simple server for Git repositories --max-connections=<n>"
},
{
"role": "assistant",
"content": "Maximum number of concurrent clients, defaults to 32. Set it to\nzero for no limit."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "cannot pull Git remote repository from Sourcetree\nI Generated ssh keys and configured my git and SourceTree. I could git pull and do other operations from Git-bash. \nNote: I have added the following in .bashrc to make it work.\neval `ssh-agent`\nssh-add\n\nHowever, when I try to git pull in SourceTree, I get this.\n\ngit -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin\n Permission denied (publickey,password). fatal: Could not read from\n remote repository.\nPlease make sure you have the correct access rights and the repository\n exists.\n\nWhen I tried to create ssh-key from Putty(windows), it goes further, but waits with this following message!\n\ngit -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin\n The server's host key is not cached in the registry. You have no\n guarantee that the server is the computer you think it is. The\n server's rsa2 key fingerprint is:\nssh-rsa 2048 0f:ee:bb:1c:6c:b4:50:0e:54:d6:e9:55:9b:38:45:df If you\n trust this host, enter \"y\" to add the key to PuTTY's cache and carry\n on connecting. If you want to carry on connecting just once, without\n adding the key to the cache, enter \"n\". If you do not trust this host,\n press Return to abandon the connection.\n\nif I open the terminal in SourceTree(which is git-bash), it asks me for passphrase. So, i suspect my .bashrc is not sourced by SourceTree. Or am I missing something else?"
},
{
"role": "assistant",
"content": "I changed the client configuration from putty to openssh.\nGo to: Menu Tools > Options > SSH Client"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to import svn branches and tags into git-svn?\nI have got a central SVN repository I must commit to, but I've got a passion for git (like any other developer I know). The case is well known.\nThen I read about git-svn and gave it a try. Since I don't need the full history, just from two months or so, I did like this:\ngit svn clone -r 34000 -s https://svn.ourdomain.com/svn/repos/Project/SubProject\n\nSubProject had, as usual, the subdirectories trunk, tags and branches. Great.\nThen, in order to get the last revision, I did\ngit svn rebase\n\nSome downloads later, great. Last revision, logs, etc. Ok, now I'll switch to my feature branch. \n$ git branch \n* master\n\n$ git branch -r \n trunk\n\n$ git branch -a \n* master\n remotes/trunk\n\nThe questions are: Where are my branches? Have I done something wrong? How should I do in order to get my branches in the new git repo? \ngit-svn, wherever I have read about it, dealt wisely with branches and tags, but the behaviour is not what I expected. Thanks!\nEDIT: I have just found out that git svn fetch will do it. But it will get all revisions, which is something I wouldn't like."
},
{
"role": "assistant",
"content": "You'll need several steps.\n\nsupply proper trunk, branches and tags folder names and fetch svn repo:\ngit svn init -t tags -b branches -T trunk https://mysvn.com/svnrepo\ngit svn fetch\n\nSince tags in svn are real branches, create git tags from tag branches:\ngit for-each-ref --format=\"%(refname:short) %(objectname)\" refs/remotes/tags | cut -d / -f 3- |\nwhile read ref\ndo\n echo git tag -a $ref -m 'import tag from svn'\ndone\n\nDelete tag branches\ngit for-each-ref --format=\"%(refname:short)\" refs/remotes/tags | cut -d / -f 2- |\nwhile read ref\ndo \n echo git branch -rd $ref\ndone\n\nSince tags marked in the previous step point to a commit \"create tag\", we need to derive \"real\" tags, i.e. parents of \"create tag\" commits.\ngit for-each-ref --format=\"%(refname:short)\" refs/tags |\nwhile read ref\ndo\n tag=`echo $ref | sed 's/_/./g'` # give tags a new name\n echo $ref -\\> $tag\n git tag -a $tag `git rev-list -2 $ref | tail -1` -m \"proper svn tag\"\ndone\n\nAll we have to do now is to remove old tags."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-branch - List, create, or delete branches branch.<name>.pushRemote"
},
{
"role": "assistant",
"content": "When on branch <name>, it overrides branch.<name>.remote for\npushing. It also overrides remote.pushDefault for pushing\nfrom branch <name>. When you pull from one place (e.g. your\nupstream) and push to another place (e.g. your own publishing\nrepository), you would want to set remote.pushDefault to\nspecify the remote to push to for all branches, and use this\noption to override it for a specific branch."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Switching users inside Docker image to a non-root user\nI'm trying to switch user to the tomcat7 user in order to setup SSH certificates.\nWhen I do su tomcat7, nothing happens.\nwhoami still ruturns root after doing su tomcat7\nDoing a more /etc/passwd, I get the following result which clearly shows that a tomcat7 user exists:\nroot:x:0:0:root:/root:/bin/bash\ndaemon:x:1:1:daemon:/usr/sbin:/bin/sh\nbin:x:2:2:bin:/bin:/bin/sh\nsys:x:3:3:sys:/dev:/bin/sh\nsync:x:4:65534:sync:/bin:/bin/sync\ngames:x:5:60:games:/usr/games:/bin/sh\nman:x:6:12:man:/var/cache/man:/bin/sh\nlp:x:7:7:lp:/var/spool/lpd:/bin/sh\nmail:x:8:8:mail:/var/mail:/bin/sh\nnews:x:9:9:news:/var/spool/news:/bin/sh\nuucp:x:10:10:uucp:/var/spool/uucp:/bin/sh\nproxy:x:13:13:proxy:/bin:/bin/sh\nwww-data:x:33:33:www-data:/var/www:/bin/sh\nbackup:x:34:34:backup:/var/backups:/bin/sh\nlist:x:38:38:Mailing List Manager:/var/list:/bin/sh\nirc:x:39:39:ircd:/var/run/ircd:/bin/sh\ngnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh\nnobody:x:65534:65534:nobody:/nonexistent:/bin/sh\nlibuuid:x:100:101::/var/lib/libuuid:/bin/sh\nmessagebus:x:101:104::/var/run/dbus:/bin/false\ncolord:x:102:105:colord colour management daemon,,,:/var/lib/colord:/bin/false\nsaned:x:103:106::/home/saned:/bin/false\ntomcat7:x:104:107::/usr/share/tomcat7:/bin/false\n\nWhat I'm trying to work around is this error in Hudson: \nCommand \"git fetch -t git@________.co.za:_______/_____________.git +refs/heads/*:refs/remotes/origin/*\" returned status code 128: Host key verification failed.\n\nThis is my Dockerfile, it takes an existing hudson war file and config that is tarred and builds an image, hudson runs fine, it just can't access git due to certificates not existing for user tomcat7.\nFROM debian:wheezy\n\n# install java on image\nRUN apt-get update\nRUN apt-get install -y openjdk-7-jdk tomcat7\n\n# install hudson on image\nRUN rm -rf /var/lib/tomcat7/webapps/*\nADD ./ROOT.tar.gz /var/lib/tomcat7/webapps/\n\n# copy hudson config over to image\nRUN mkdir /usr/share/tomcat7/.hudson\nADD ./dothudson.tar.gz /usr/share/tomcat7/\nRUN chown -R tomcat7:tomcat7 /usr/share/tomcat7/\n\n# add ssh certificates\nRUN mkdir /root/.ssh\nADD ssh.tar.gz /root/\n\n# install some dependencies\nRUN apt-get update\nRUN apt-get install --y maven\nRUN apt-get install --y git\nRUN apt-get install --y subversion\n\n# background script\nADD run.sh /root/run.sh\nRUN chmod +x /root/run.sh\n\n# expose port 8080\nEXPOSE 8080\n\n\nCMD [\"/root/run.sh\"]\n\nI'm using the latest version of Docker (Docker version 1.0.0, build 63fe64c/1.0.0), is this a bug in Docker or am I missing something in my Dockerfile?"
},
{
"role": "assistant",
"content": "You should not use su in a dockerfile, however you should use the USER instruction in the Dockerfile.\nAt each stage of the Dockerfile build, a new container is created so any change you make to the user will not persist on the next build stage.\nFor example:\nRUN whoami\nRUN su test\nRUN whoami\n\nThis would never say the user would be test as a new container is spawned on the 2nd whoami. The output would be root on both (unless of course you run USER beforehand).\nIf however you do:\nRUN whoami\nUSER test\nRUN whoami\n\nYou should see root then test.\nAlternatively you can run a command as a different user with sudo with something like\nsudo -u test whoami\n\nBut it seems better to use the official supported instruction."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git: Pushing to two repos in one command\nI want to do git push origin and git push my_other_remote in the same line. Possible?"
},
{
"role": "assistant",
"content": "You can get the same effect by adding an extra push URL for your origin remote. For example, if the URLs of your existing remotes are as follows:\n$ git remote -v\norigin me@original:something.git (fetch)\norigin me@original:something.git (push)\nmy_other_remote git://somewhere/something.git (fetch)\nmy_other_remote git://somewhere/something.git (push)\n\nYou could do:\n git remote set-url --add --push origin git://somewhere/something.git\n\nThen, git push origin will push to both repositories. You might want to set up a new remote called both for this, however, to avoid confusion. For example:\n git remote add both me@original:something.git\n git remote set-url --add --push both me@original:something.git\n git remote set-url --add --push both git://somewhere/something.git\n\n... then:\n git push both\n\n... will try to push to both repositories."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Uninitialize git repository\nI have Initialized a git repository and have made some commit in that now for some reason I do not want to track any files in it and want to remove git from my local repo.\nIs there some way I can Uninitialize it?"
},
{
"role": "assistant",
"content": "git stores all the repository related data in a folder named \".git\" inside your repository folder. So you just want to keep your files but change it into a \"not-git-repository\". Warning: this is irreversible!\ncd path/to/repo\nrm -rf .git\n\nThe only files that might remain are hidden \".gitignore\" files (but only if you added them yourself or using some tool like eclipse). To remove them:\nfind . -name \".gitignore\" | xargs rm"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index -G<regex>"
},
{
"role": "assistant",
"content": "Look for differences whose patch text contains added/removed\nlines that match <regex>. To illustrate the difference between -S<regex> --pickaxe-regex and -G<regex> , consider a commit with the following diff in the same\nfile: + return frotz(nitfol, two->ptr, 1, 0);\n...\n- hit = frotz(nitfol, mf2.ptr, 1, 0); While git log -G\"frotz\\(nitfol\" will show this commit, git log\n-S\"frotz\\(nitfol\" --pickaxe-regex will not (because the number of\noccurrences of that string did not change). Unless --text is supplied patches of binary files without a textconv\nfilter will be ignored. See the pickaxe entry in gitdiffcore for more\ninformation."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-shortlog - Summarize git log output -w[<width>[,<indent1>[,<indent2>]]]"
},
{
"role": "assistant",
"content": "Linewrap the output by wrapping each line at width . The first\nline of each entry is indented by indent1 spaces, and the second\nand subsequent lines are indented by indent2 spaces. width , indent1 , and indent2 default to 76, 6 and 9 respectively. If width is 0 (zero) then indent the lines of the output without wrapping\nthem."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Visual Studio: Change default path for repositories for GIT plugin\nI want to clone a GitHub repository from Visual Studio, and the default path is C:\\Users\\[User]\\Sources\\Repos\\[NameOfProject].\n\nHow do I change it? Every time I create or clone a repo, the path remains the same."
},
{
"role": "assistant",
"content": "In Visual Studio 2015 / 2017 / 2019:\n\nGo to the menu bar, click View and then select Team Explorer\nClick the Home icon button in Team Explorer\nClick on Settings\nClick on Global Settings under Git\n(Note: may not appear if you have no cloned git repos)\nAlter the path for the Default location.\nClick OK/Update\n\nNote: the location is case-sensitive, and it will not warn you if that exact location is not found"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to find origin of a branch in git?\nSay if my project contains two masters (master and master_ios) and I want to see what the origin of a feature branch is (by origin, i mean the branch the feature branch is based off), how would I accomplish this in git?"
},
{
"role": "assistant",
"content": "git remote show origin\n\nshows remote and local branches with tracking info."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Telling git its ok to remove untracked files [duplicate]\nThis question already has answers here:\n \n \n\n\n\nClosed 12 years ago.\n\n\n\n\nPossible Duplicate:\nHow do you remove untracked files from your git working copy? \n\nIs it possible to tell git to remove untracked files? Mainly something that is similar to a reset?\nexample:\ngit checkout -- index.php <-- revert my file\ngit checkout -- master <-- this would revert the entire repo back to the last commit on master, removing (deleting) any and all untracked files as well as reverting committed ones.\n\nI know this is trivial to do on the shell. But I'd like to know if this can be done in Git?"
},
{
"role": "assistant",
"content": "You need git clean but add the -df to enable removing files that are in directories from where you are. Add x to include ignored files.\nSo to completely clean your working directory leaving only what is in source control, issue this command:\ngit clean -xdf"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-grep - Print lines matching a pattern --max-depth <depth>"
},
{
"role": "assistant",
"content": "For each <pathspec> given on command line, descend at most <depth>\nlevels of directories. A value of -1 means no limit.\nThis option is ignored if <pathspec> contains active wildcards.\nIn other words if \"a*\" matches a directory named \"a*\",\n\"*\" is matched literally so --max-depth is still effective."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitglossary - A Git Glossary object identifier (oid)"
},
{
"role": "assistant",
"content": "Synonym for object name ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to fix : failed to push some refs to gitlab?\n\nI tried to push the project to the repository of GitLab but there was an error occurred.\nTo https://gitlab.com/codersclan-interviews-frontend/codersclan-david-rose.git\n ! [remote rejected] test -> test (pre-receive hook declined)\nerror: failed to push some refs to 'https://gitlab.com/codersclan-interviews-frontend/codersclan-david-rose.git' \n\nHow can I fix this?\nGit repository wasn't created by me, it was created by the client.\nAnd he asked me to push the code to the branch which I made by myself and let him know when I finish.\nTo do this task, I did like following\ngit clone https://gitlab.com/codersclan-interviews-frontend/codersclan-david-rose.git\ngit checkout -b 'test'\ngit branch test\nadd project\ngit add .\ngit commit -m \"...\"\ngit push origin test\n\nI expected the successful push result but the above error occurred."
},
{
"role": "assistant",
"content": "This could also happen as a result of a protected branch name. Try changing your branch name to something that isn't a protected name on the remote repository. hotfix, development and the likes may be protected names."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-hash-object - Compute object ID and optionally create an object from a file -t <type>"
},
{
"role": "assistant",
"content": "Specify the type of object to be created (default: \"blob\"). Possible\nvalues are commit , tree , blob , and tag ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Delete a closed pull request from GitHub\n\nI accidentally made a wrong pull request and ended up closing the request myself. It's in a closed state right now but it's accessible via direct URL and showing on my activity bar.\nIs there any way to delete a pull request completely so it's no longer accessible via URL or shows up on your activity history?"
},
{
"role": "assistant",
"content": "There is no way you can delete a pull request yourself -- you and the repo owner (and all users with push access to it) can close it, but it will remain in the log. This is part of the philosophy of not denying/hiding what happened during development.\nHowever, if there are critical reasons for deleting it (this is mainly violation of Github Terms of Service), Github support staff will delete it for you.\nWhether or not they are willing to delete your PR for you is something you can easily ask them, just drop them an email at [email protected]\nUPDATE: Currently Github requires support requests to be created here: https://support.github.com/contact"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Cannot push to git repository - permission denied\n\nI have a following problem:\n$ git push -u origin master\nPermission denied (publickey).\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n\nI have already checked the connection doing this:\n$ ssh -vT [email protected]\n\nand output looks good, I was correctly authenticated.\nWhile checking further, I noticed that:\n$ ssh-add -l\nThe agent has no identities.\n\nI have tried to run ssh-agent, but nothing changed:\n$ ssh-agent\nSSH_AUTH_SOCK=/tmp/ssh-A1mhFqvqncuO/agent.766; export SSH_AUTH_SOCK;\nSSH_AGENT_PID=767; export SSH_AGENT_PID;\necho Agent pid 767;\n$ ssh-add -l\nCould not open a connection to your authentication agent.\n\nI am using Arch Linux. Any help would be strong appreciated! Thanks in advance!\nGithub diagnostic help here."
},
{
"role": "assistant",
"content": "I had the similar problem and my problem was solved by running the following command to add my key to the list of known keys:\nssh-add ~/.ssh/id_rsa\n\nHope it solves yours too. ;)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitcli - Git command-line interface and conventions"
},
{
"role": "assistant",
"content": "SYNOPSIS gitcli"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options submodule.<name>.fetchRecurseSubmodules"
},
{
"role": "assistant",
"content": "This option can be used to control recursive fetching of this\nsubmodule. It can be overridden by using the --[no-]recurse-submodules\ncommand-line option to \"git fetch\" and \"git pull\".\nThis setting will override that from in the gitmodules file."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --color-moved-ws=<modes>"
},
{
"role": "assistant",
"content": "This configures how whitespace is ignored when performing the\nmove detection for --color-moved .\nIt can be set by the diff.colorMovedWS configuration setting.\nThese modes can be given as a comma separated list: no Do not ignore whitespace when performing move detection. ignore-space-at-eol Ignore changes in whitespace at EOL. ignore-space-change Ignore changes in amount of whitespace. This ignores whitespace\nat line end, and considers all other sequences of one or\nmore whitespace characters to be equivalent. ignore-all-space Ignore whitespace when comparing lines. This ignores differences\neven if one line has whitespace where the other line has none. allow-indentation-change Initially ignore any whitespace in the move detection, then\ngroup the moved code blocks only into a block if the change in\nwhitespace is the same per line. This is incompatible with the\nother modes."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fsck - Verifies the connectivity and validity of the objects in the database fsck.skipList"
},
{
"role": "assistant",
"content": "The path to a list of object names (i.e. one unabbreviated SHA-1 per\nline) that are known to be broken in a non-fatal way and should\nbe ignored. On versions of Git 2.20 and later, comments ( # ), empty\nlines, and any leading and trailing whitespace are ignored. Everything\nbut a SHA-1 per line will error out on older versions. This feature is useful when an established project should be accepted\ndespite early commits containing errors that can be safely ignored,\nsuch as invalid committer email addresses. Note: corrupt objects\ncannot be skipped with this setting. Like fsck.<msg-id> this variable has corresponding receive.fsck.skipList and fetch.fsck.skipList variants. Unlike variables like color.ui and core.editor the receive.fsck.skipList and fetch.fsck.skipList variables will not\nfall back on the fsck.skipList configuration if they aren’t set. To\nuniformly configure the same fsck settings in different circumstances,\nall three of them must be set to the same values. Older versions of Git (before 2.20) documented that the object names\nlist should be sorted. This was never a requirement; the object names\ncould appear in any order, but when reading the list we tracked whether\nthe list was sorted for the purposes of an internal binary search\nimplementation, which could save itself some work with an already sorted\nlist. Unless you had a humongous list there was no reason to go out of\nyour way to pre-sort the list. After Git version 2.20 a hash implementation\nis used instead, so there’s now no reason to pre-sort the list."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I show my global Git configuration?\nI'd like to show all configured Git sections.\nI only found git config --get core.editor, and I'd like to output everything that's configured globally, not only the configured default editor."
},
{
"role": "assistant",
"content": "You can use:\ngit config --list\n\nor look at your ~/.gitconfig file. The local configuration will be in your repository's .git/config file.\nUse:\ngit config --list --show-origin\n\nto see where that setting is defined (global, user, repo, etc...)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I change my author name on GitHub?\n\nI'm new to web development and GitHub. When I commit any changes, these changes are reflected on my GitHub repo under \"unknown (author)\". How do I change this to reflect my name/email address?\nThanks."
},
{
"role": "assistant",
"content": "$ git config --global user.name \"Scott Chacon\"\n$ git config --global user.email \"[email protected]\""
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Why can't I push from a shallow clone?\nThe git clone --depth command option says\n--depth <depth> \nCreate a shallow clone with a history truncated to the specified number of revisions. \nA shallow repository has a number of limitations \n(you cannot clone or fetch from it, nor push from nor into it),\n but is adequate if you are only interested in the recent history of a large project with a long history,\n and would want to send in fixes as patches. \n\nWhy do shallow clones have this limitation? Why is it a patches only workflow?\nFor some project workflows I need to pass just the latest commit from a single branch to a coder, and then have them be able to push their (fast forward) developments to the main server. This partly for security, IP protection and repo size, and partly to reduce the confusion that a big repo would bring to a naive coder. Is there a git workflow that allows this?\n\nUpdate: Based on Karl Bielefeldt's answer the git checkout --orphan should be the right answer. But one still needs to 'clone' that branch alone to the new user, and be able to push it effectively.\nThe man page states:\n\ngit checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>] --orphan\nCreate a new orphan branch, named <new_branch>, started from\n <start_point> and switch to it. The first commit made on this new\n branch will have no parents and it will be the root of a new history\n totally disconnected from all the other branches and commits.\nThe index and the working tree are adjusted as if you had previously\n run git checkout <start_point>. This allows you to start a new\n history that records a set of paths similar to <start_point> by\n easily running git commit -a to make the root commit.\nThis can be useful when you want to publish the tree from a commit\n without exposing its full history. You might want to do this to\n publish an open source branch of a project whose current tree is\n \"clean\", but whose full history contains proprietary or otherwise\n encumbered bits of code.\nIf you want to start a disconnected history that records a set of\n paths that is totally different from the one of <start_point>, then\n you should clear the index and the working tree right after creating\n the orphan branch by running git rm -rf . from the top level of the\n working tree. Afterwards you will be ready to prepare your new files,\n repopulating the working tree, by copying them from elsewhere,\n extracting a tarball, etc.\n\nVonC's link to Junio's comments is interesting. I think the manual should provide the guidance in this case, and allow the right command [e.g. clone <branch> --options] to extract just the relevant part of the repo. Obviously the probability of push success is increased by having a few linked commits and SHA1s at the bottom of the history that will lock down the repo matching.\n\nUpdate Git 1.9.0 : release notes 14 Feb '14.\n\"Fetching from a shallowly-cloned repository used to be forbidden,\nprimarily because the codepaths involved were not carefully vetted\nand we did not bother supporting such usage. This release attempts\nto allow object transfer out of a shallowly-cloned repository in a\nmore controlled way (i.e. the receiver becomes a shallow repository\nwith a truncated history).\"\nThis is good news for the shallow cloners.\nNext - Narrow clones possibly."
},
{
"role": "assistant",
"content": "As Junio C. Hamano (main Git maintainer) puts it:\n\nIsn't the rule more or less like:\n\nIf your shallow repository's history does not extend long enough and the other repository forked before your truncated history, wyou cannot compute the common ancestor and you cannot push out. \n\n\nUpdate 2014: see \"Is git clone --depth 1 (shallow clone) more useful than it makes out?\": that limitation will be lifted with Git 1.9!\nUpdate 2015: with Git 2.5+, you will even be able to fetch a single commit. See \"Pull a specific commit from a remote git repository\"\n\nOriginal answer (August 2011):\n\nActually, come to think of it, it is a lot stronger than \"cannot compute\n the common\".\nThe history may look like this:\n\n R---R---R\n /\n --R---R---X---X---S---S---S\n\n\nwhere S are the commits you have in your shallow repository, and R are the commits that exist in the repository that receives your push.\n Because your history is shallow, neither repository has 'X' that are the commits that need to exist in order to keep the history of recipient repository complete; the recipient is not shallow to begin with, and we do not want to make it shallow.\nIf you cloned shallowly some time ago, worked without communicating with the other side while the other side progressed, AND if the other side's progress included a rewind & rebuild of the history, you would see a similar topology.\n The leftmost 'S' in the above picture might have been the tip of the branch when you shallowly cloned with depth 1, and since then the remote end may have discarded topmost three commits and have rebuilt its history that leads to the rightmost 'R'.\n In such a case pushing to the remote's HEAD will fail. \n\n\nSo it could work in some case, but it is not supported:\nIf I have to say something on this...\n\n\nI think \"is not supported\" is a succinct way to give good enough information, but it would only work for intelligent people.\nNot everybody is intelligent; some try it out themselves, see that the operation seems to work for their limited number of trials, and would conclude it would work most of the time.\n And they congratulate their own intelligence for saying \"most of the time\", not \"always\".\n And they get upset when they see it does not work, even though they have been warned.\n\n\n\nFor more on the shallow clone update process, see \"How to update a git shallow clone?\"."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-describe - Give an object a human readable name based on an available ref --debug"
},
{
"role": "assistant",
"content": "Verbosely display information about the searching strategy\nbeing employed to standard error. The tag name will still\nbe printed to standard out."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Remove Credentials from GIT in Jenkins\nAnybody knows how to remove the users from the Credentials drop down in Jenkins for a project under Source Code Management -> Git Repositories\nReferring to the section highlighted in yellow in attached screen shot: \nI seem to have added a few users in error and want to remove them from the drop down. I dont see any option to delete them."
},
{
"role": "assistant",
"content": "Ok i found it, just had to look around. It was under the Jenkins Home page -> Credentials.\nIt is not present under the Credentials section of the Configuration page. I thought since it was GIT based, it was storing users under that configuration."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab: Search Commits per user\n\nAs an admin, I would like to find out how many commits are done per branch, per user, total commits by a user in last 3 months, total commits in last 3 months. etc.. How can I do this ?\nI could see this on Github like this: List commit by user\nI want to see the same thing for GitLab also. \nI am running Gitlab CE version: 7.2.1\nI thought of running git log --author='userid' but this will take forever to run for so many user / so many branches. Same would apply for running Gitstats because I have to sync all the branches locally first.\nAny pointers please?"
},
{
"role": "assistant",
"content": "Gitstats is good to get html reports. It internally runs the git commands that you can easily change in its source to get your own kind of report.\nOn another note, I don't think git log should take long. You can try this sample and confirm how long it takes\ngit log --date=short --branches --since=3.months.ago --author=xyz\nRunning without using --author will give all the commits pushed in last three months. \nA list of authors can be used in a single command , it should be separated by a | \nAdditionally you can use --pretty option to print information in desired format. You can play around with pretty format option as it is rich in offering various formats.\nYou can also chose this to run on list of specific branches by having them in a iteration loop. Git is very fast in getting this information."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I copy files from a branch to another using git?\nI have a git repository with two branches: master and gh-pages. If I want to copy a file foo from master to gh-pages without merging them. What command should I use? Many thanks."
},
{
"role": "assistant",
"content": "You can:\ngit checkout gh-pages\ngit checkout master foo\ngit commit -m 'Add file foo to gh-pages.'"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc patience"
},
{
"role": "assistant",
"content": "Use \"patience diff\" algorithm when generating patches."
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.