messages listlengths 3 3 |
|---|
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to access and modify a SSH file on mac? [closed]\nClosed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.\n \n \n\n\n\n\n\n\n\n\n\n\n\n This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.\n\n\nClosed 2 years ago.\n\n\nThe community reviewed whether to reopen this question 2 years ago and left it closed:\n\nOriginal close reason(s) were not resolved\n\n\n\n\n\n\n Improve this question\n \n\n\n\nI'm trying to setup SSH on my computer but not sure how to access the ~/.ssh/config file. From github's website they mention this file has to be modified but I'm not sure where its located or how to modify it.\nOn Github:\n\nIf you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.\n\nHost *\n AddKeysToAgent yes\n UseKeychain yes\n IdentityFile ~/.ssh/id_rsa"
},
{
"role": "assistant",
"content": "Start Terminal and create the ~/.ssh directory if it doesn't exist:\nmkdir -p ~/.ssh\n\nNow go into the directory:\ncd ~/.ssh\n\nNow open the file config with the default editor:\nopen -t config\n\nIf it says that file doesn't exist, create it with:\ntouch config\n\nand try opening again:\nopen -t config\n\nWhen you edit the file, make sure it is \"Plain Text\" using the menu at the top of the screen and clicking Format->Make Plain Text.\nSet the permissions as instructed in your tutorial."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git Pull vs. Pull Request\nI'm new to using Git, so I apologize if this is trivial. I have a private repository set up using Github and EGit.\nTo update and merge my local repository branch with the remote version (essentially a git pull), I use Team > Pull in Eclipse.\nTo merge a branch into the master branch, I have to request and subsequently approve a Pull Request on Github.\n\nWhat is the difference between calling git pull and sending a pull request? \n\nI've seen that this is related to a Fork and Pull collaborative development model and is used for code reviews. I think I understand the motivation and usefulness of a pull request, but what exactly is it?"
},
{
"role": "assistant",
"content": "If you use git pull, you pull the changes from the remote repository into yours.\nIf you send a pull request to another repository, you ask their maintainers to pull your changes into theirs (you more or less ask them to use a git pull from your repository).\nIf you are the maintainer of that repository, it seems you're making it a bit more difficult by pretending you're playing two roles in that workflow. You might as well merge locally your development branch into your master branch and push that master branch into your GitHub repository directly.\n(As a side note, if you're new to Git, I'd suggest using git fetch and then git merge instead of git pull. git pull is effectively git fetch followed by git merge, but doing them separately gives you better control over potential conflicts.)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GIT_EDITOR not working with macvim\nThis is what I have in my ~/.bashrc\nexport GIT_EDITOR='/Applications/MacVim.app/Contents/MacOS/Vim -g '\n\nWhen I issue\ngit commit\n\nthen I get a macvim editor but on the command line I see this message\n$ git commit\nAborting commit due to empty commit message.\n\nIf I use change GIT_EDITOR to use textmate then things work fine\nexport GIT_EDITOR='/usr/local/bin/mate -w'\n\nI don't want to use textmate. I want to use macvim. I am using mac and use bash."
},
{
"role": "assistant",
"content": "You need to supply the -f option to vim to ensure that it doesn't background itself."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options init.templateDir"
},
{
"role": "assistant",
"content": "Specify the directory from which templates will be copied. (See the \"TEMPLATE DIRECTORY\" section of git-init .)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I navigate in the results of Diff\nWhen I do a Git diff, it shows the code with the diff and it looks great. But how do I go to the next page or the next document."
},
{
"role": "assistant",
"content": "Next line : return\nNext page : space bar\nPrevious page : w\nQuit viewing the diff : q\nHelp : h"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "rebase reverted merged branch\nBackground: I recently merged a rather large topic branch into master. A couple of days later I discovered this topic branch contained bugs. So I git revert -m 1 <merge-commit>ed it.\nProblem: Now I'd like to check out the topic branch and rebase it against current master so that I can 1) fix the bugs and 2) (again) merge the fixed up topic branch with master. Creating the new branch, fixedtopic is the easy part, but every time I do\ngit checkout fixedtopic\ngit rebase master\n\ngit decides that it's not willing to replay the old commits since they are already merged into master. Instead it simply does a fast-forward rebase.\nQuestion: How can force replay of the commits onto fixedtopic using rebase? Can I? I'd rather not use cherry-pick since it's a bit more cumbersome.\nAdditional:\n\ngit reseting the merge commit it not an option, since I have pushed the master upstream.\nI'd rather not create a new branch off of master and revert my revert. The reason for this is that I'd like to rewrite some of the topic branch's history using interactive rebase.\nHere's a github gist of the scenario: https://gist.github.com/JensRantil/6352495 Note that I'd like e8df5ec and ee16464 applied onto master (or branch based on master)."
},
{
"role": "assistant",
"content": "The documentation (git help rebase) suggests that \"git rebase --force-rebase\" does just this -- but (Git 1.9.1) it doesn't. The documentation also suggests that \"git rebase -i --no-ff\" is equivalent to that command -- but it isn't: it does work.\nHaving cloned your gist, the commands:\n git checkout topic\n git rebase -i --no-ff --onto master 7b3af topic\n\nproduce the desired result, with new versions of the \"third\" and \"fourth\" commits on top of master, and topic pointing at the new version of \"fourth\". In the second command, the SHA 7b3af is the \"second\" commit, the point where topic was branched from."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitHub: Clone succeeded, but checkout failed\n\nI am having some problems working with \ngit clone.The files are downloaded in my local git folder. Running the command\ngit checkout -f HEAD gives me-\nError:\n\n'The unable to write new index file error caused by the lack of disk space'. \n\nI've manually removed big files from my computer, but still getting the same error.\nCloning into 'ffmpeg'...\nremote: Counting objects: 7890, done. \nremote: Compressing objects: 100% (4412/4412), done.\nReceiving objects: 100% (7890/7890), 299.75 MiB | 24.19 MiB/s, done.\nremote: Total 7890 (delta 3346), reused 7846 (delta 3317)\nResolving deltas: 100% (3346/3346), done.\nChecking out files: 100% (7019/7019), done.\nfatal: unable to write new index file\nwarning: Clone succeeded, but checkout failed.\nYou can inspect what was checked out with 'git status'\nand retry the checkout with 'git checkout -f HEAD'"
},
{
"role": "assistant",
"content": "For me this was due to long file names and doing a simple config as below resolved it\n\ngit config --system core.longpaths true"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --default-prefix"
},
{
"role": "assistant",
"content": "Use the default source and destination prefixes (\"a/\" and \"b/\").\nThis overrides configuration variables such as diff.noprefix , diff.srcPrefix , diff.dstPrefix , and diff.mnemonicPrefix (see git-config (1))."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-commit-tree - Create a new commit object ISO 8601"
},
{
"role": "assistant",
"content": "Time and date specified by the ISO 8601 standard, for example 2005-04-07T22:13:13 . The parser accepts a space instead of the T character as well. Fractional parts of a second will be ignored,\nfor example 2005-04-07T22:13:13.019 will be treated as 2005-04-07T22:13:13 . Note In addition, the date part is accepted in the following formats: YYYY.MM.DD , MM/DD/YYYY and DD.MM.YYYY ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to tell git to use the correct identity (name and email) for a given project?\n\nI use my personal laptop for both work and personal projects and I would like to use my work email address for my commits at work (gitolite) and my personal email address for the rest (github).\nI read about the following solutions which are all either global or temporary:\n\ngit config --global user.email \"[email protected]\"\ngit config user.email \"[email protected]\"\ngit commit --author \"Bob <[email protected]>\"\nsetting one of the GIT_AUTHOR_EMAIL, GIT_COMMITTER_EMAIL or EMAIL environment variables\n\nOne solution is to run manually a shell function that sets my environment to work or personal, but I am pretty sure that I will often forget to switch to the correct identity resulting in committing under the wrong identity.\nIs there a way of binding a certain repository, project name, etc. to an identity (name, email)? What do people do?"
},
{
"role": "assistant",
"content": "git config user.email \"[email protected]\"\nDoing that one inside a repo will set the configuration on THAT repo, and not globally.\nSeems like that's pretty much what you're after, unless I'm misreading you."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options gitcvs.allBinary"
},
{
"role": "assistant",
"content": "This is used if gitcvs.usecrlfattr does not resolve\nthe correct -kb mode to use. If true, all\nunresolved files are sent to the client in\nmode -kb . This causes the client to treat them\nas binary files, which suppresses any newline munging it\notherwise might do. Alternatively, if it is set to \"guess\",\nthen the contents of the file are examined to decide if\nit is binary, similar to core.autocrlf ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to determine which forks on GitHub are ahead?\n\nSometimes, the original GitHub repository of a piece of software I'm using, such as linkchecker, is seeing little or no development, while a lot of forks have been created (in this case: 142, at the time of writing).\nFor each fork, I'd like to know:\n\nwhich branches it has with commits ahead of the original master branch\n\nand for each such branch:\n\nhow many commits it is ahead of the original\nhow many commits it is behind\n\nGitHub has a web interface for comparing forks, but I don't want to do this manually for each fork, I just want a CSV file with the results for all forks. How can this be scripted? The GitHub API can list the forks, but I can't see how to compare forks with it. Cloning every fork in turn and doing the comparison locally seems a bit crude."
},
{
"role": "assistant",
"content": "Edit: This solution has to be adjusted to a recent change of the GitHub website. GitHub for some reason doesn't show the number of commits immediately anymore, but fetches it with a script as discussed here. Our bookmarklet should be edited to perform the same fetching.\nAfter clicking \"Insights\" on top and then \"Forks\" on the left, the following bookmarklet prints the info (including links to ZIP files) directly onto the web page like this:\n\nOr like this if you click \"Switch to tree view\":\n\nThe code to add as a bookmarklet (or to paste into the console):\njavascript:(async () => {\n /* while on the forks page, collect all the hrefs and pop off the first one (original repo) */\n const aTags = [...document.querySelectorAll('div.repo a:last-of-type')].slice(1).concat([...document.querySelectorAll('div.repository-content ul a:last-of-type:not(.Link--muted)')]);\n\n for (const aTag of aTags) {\n /* fetch the forked repo as html, search for the \"This branch is [n commits ahead,] [m commits behind]\", print it directly onto the web page */\n await fetch(aTag.href)\n .then(x => x.text())\n .then(html => aTag.outerHTML += `${html.match(/This branch is.*/).pop().replace('This branch is', '').replace(/([0-9]+ commits? ahead)/, '<font color=\"#0c0\">$1</font>').replace(/([0-9]+ commits? behind)/, '<font color=\"red\">$1</font>')}` + \" <a \" + `${html.match(/href=\"[^\"]*\\.zip\">/).pop() + \"Download ZIP</a>\"}`)\n .catch(console.error);\n }\n})();\n\nYou can also paste the code into the address bar, but note that some browsers delete the leading javascript: while pasting, so you'll have to type javascript: yourself. Or copy everything except the leading j, type j, and paste the rest.\nIt has been modified from this answer."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-for-each-repo"
},
{
"role": "assistant",
"content": "Run a Git command on a list of repositories"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-shortlog - Summarize git log output <revision-range>"
},
{
"role": "assistant",
"content": "Show only commits in the specified revision range. When no\n<revision-range> is specified, it defaults to HEAD (i.e. the\nwhole history leading to the current commit). origin..HEAD specifies all the commits reachable from the current commit\n(i.e. HEAD ), but not from origin . For a complete list of\nways to spell <revision-range>, see the \"Specifying Ranges\"\nsection of gitrevisions ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Renaming a branch while on pull request\nOn Github, you can make pull requests to add functionality to a project. One's contributions have to be on a branch that, if the request is accepted, will be merged into the master branch (or an analogous one) of the project.\nNow, I submitted a pull request on Github and my contributions are on a branch called patch-1. I can modify the name of the branch locally by\ngit branch -m patch-1 newname\n\nand in principle I can also rename it on my forked repo on Github by following the instruction found in this answer. This is done in practice by removing the old branch, patch-1 in my case, and repush it with a different name newname.\nIs it allowed to rename the branch patch-1 on my forked repository on Github when it constitutes a pull request?\nOr it causes problems on the pull request management?\nIs there any way to rename a branch on a forked repository on Github when that branch is a pull request?"
},
{
"role": "assistant",
"content": "\"Renaming\" a remote branch in git, as indicated by the link you provided, is really just deleting a branch, followed by pushing a new one with the same commit hash but a new name. If you have a pull request open for branch patch-1, when you delete that branch, the pull request will be closed. \nSo, no you can't rename the branch with a pull request open without deleting the branch and removing the pull request. However, there's nothing stopping you from doing that, pushing a new branch with a new name, and creating a new pull request."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-apply - Apply a patch to files and/or to the index --no-add"
},
{
"role": "assistant",
"content": "When applying a patch, ignore additions made by the\npatch. This can be used to extract the common part between\ntwo files by first running diff on them and applying\nthe result with this option, which would apply the\ndeletion part but not the addition part."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Where does Git store the SHA1 of the commit for a submodule?\nI know that when you add a submodule to a git repository it tracks a particular commit of that submodule referenced by its sha1.\nI'm trying to find where this sha1 value is stored.\nThe .gitmodules and .git/config files only show the paths for the submodule, but not the sha1 of the commit.\nThe git-submodule(1) reference only speaks of a gitlink entry and the gitmodules(5) reference doesn't say anything about this either."
},
{
"role": "assistant",
"content": "It is stored in Git's object database directly. The tree object for the directory where the submodule lives will have an entry for the submodule's commit (this is the so-called \"gitlink\").\nTry doing git ls-tree master <path-to-directory-containing-submodule> (or just git ls-tree master if the submodule lives in the top-level directory)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I cache steps in GitHub actions?\n\nSay I have a GitHub actions workflow with 2 steps.\n\nDownload and compile my application's dependencies.\nCompile and test my application\n\nMy dependencies rarely change and the compiled dependencies can be safely cached until I next change the lock-file that specifies their versions.\nIs a way to save the result of the first step so that in future workflow can skip over that step?"
},
{
"role": "assistant",
"content": "Most use-cases are covered by existing actions, for example:\n\nactions/setup-node for JS\ndocker/build-push-action for Docker\n\n\nCustom caching is supported via the cache action. It works across both jobs and workflows within a repository. See also: GitHub docs and Examples.\nConsider the following example:\nname: GitHub Actions Workflow with NPM cache\n\non: push\n\njobs:\n build:\n\n runs-on: ubuntu-latest\n\n steps:\n - uses: actions/checkout@v3\n\n - name: Cache NPM dependencies\n uses: actions/cache@v3\n with:\n path: ~/.npm\n key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}\n restore-keys: |\n ${{ runner.OS }}-npm-cache-\n\n - name: Install NPM dependencies\n run: npm install\n\nHow caching works step-by-step:\n\nAt the Cache NPM dependencies step, the action will check if there's an existing cache for the current key\nIf no cache is found, it will check spatial matches using restore-keys. In this case, if package-lock.json changes, it will fall back to a previous cache. It is useful to prefix keys and restore keys with the OS and name of the cache, as it shouldn't load files for a different type of cache or OS.\nIf any cache is found, it will load the files to path\nThe CI continues to the next step and can use the filed loaded from the cache. In this case, npm install will use the files in ~/.npm to save downloading them over the network (note that for NPM, caching node_modules directly is not recommended).\nAt the end of the CI run a post-action is executed to save the updated cache in case the key changes. This is not explicitly defined in the workflow, rather it is built into the cache action to take care of both loading and saving the cache.\n\n\nYou can also build your own reusable caching logic with @actions/cache such as:\n\n1-liner NPM cache\n1-liner Yarn cache\n\n\nOld answer:\nNative caching is not currently possible, expected to be implemented by mid-November 2019.\nYou can use artifacts (1, 2) to move directories between jobs (within 1 workflow) as proposed on the GH Community board. This, however, doesn't work across workflows."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-commit - Record changes to the repository verbatim"
},
{
"role": "assistant",
"content": "Do not change the message at all."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Can I checkout github wikis like a git repository?\nI want to modify and view github wikis with local editor like Emacs, and Google Code wikis can be checked out just like code. Is there any way to checkout github wikis? Or is there any other git repository provider offers such feature?"
},
{
"role": "assistant",
"content": "You can now!\ngit clone https://github.com/user/project.wiki.git\n\nor if you use ssh\ngit clone [email protected]:username/project.wiki.git"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-list - Lists commit objects in reverse chronological order --full-history"
},
{
"role": "assistant",
"content": "Same as the default mode, but does not prune some history."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How could I remove my approval from a pull request on github?\n\nI approved a pull request of a random repository I do not have write access too. How can I remove or delete that approval?"
},
{
"role": "assistant",
"content": "Dismiss review\nYou can \"Dismiss review\" in the bottom section of the PR.\n\nexpand approval(s)\nclick three dots\nchoose Dismiss review\n\n(not present in the timeline - little bit confusing)\n\nthen it looks like (in the timeline)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs remerge, r"
},
{
"role": "assistant",
"content": "Remerge two-parent merge commits to create a temporary tree\nobject—potentially containing files with conflict markers\nand such. A diff is then shown between that temporary tree\nand the actual merge commit. The output emitted when this option is used is subject to change, and\nso is its interaction with other options (unless explicitly\ndocumented)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --patch-with-stat"
},
{
"role": "assistant",
"content": "Synonym for -p --stat ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitHub pages only showing ReadMe file?\n\nI'm trying to host my webpages into Github pages but for some reason it seems to only show my Readme file.\nGitHub repo: https://github.com/InquisitiveDev2016/InquisitiveDev2016.github.io\nWebsite: \nhttps://inquisitivedev2016.github.io/"
},
{
"role": "assistant",
"content": "GitHub Pages is doing what it is designed to do: hosting the contents of that repository.\nThe root of the question asker's repository only contained a single file (README.md). So there isn't an easy way to navigate to the other pages, e.g. repo/website/webpage.html.\nConsider moving your web content into the root of your repository and renaming your default page to index.md or index.html, depending what type of file it is. (By convention the default page of most websites is called index.html, and this is what GitHub Pages will show by default if it exists.)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do you specify Mermaid configuration within Gitlab Markdown?\n\nIn Gitlab, I've been able to render an Entity Relationship Diagram with Mermaid in a Markdown file as specified here.\nThis is the Markdown I used:\n```mermaid\nerDiagram\n CUSTOMER }|..|{ DELIVERY-ADDRESS : has\n CUSTOMER ||--o{ ORDER : places\n CUSTOMER ||--o{ INVOICE : \"liable for\"\n DELIVERY-ADDRESS ||--o{ ORDER : receives\n INVOICE ||--|{ ORDER : covers\n ORDER ||--|{ ORDER-ITEM : includes\n PRODUCT-CATEGORY ||--|{ PRODUCT : contains\n PRODUCT ||--o{ ORDER-ITEM : \"ordered in\"\n \n```\n\nThe mermaid interactive editor provides an example of configuration:\n{\n \"theme\": \"default\"\n}\n\nBut I don't know where to locate that configuration information. I've tried putting it in the same directory, in a file called config.json or mermaid-config.json, but neither of those have worked. I also tried including it in the Markdown which defined the diagram, which only caused it to render incorrectly. Is there a way to specify the theme or other CSS elements for Gitlab?"
},
{
"role": "assistant",
"content": "Just tried it out and it worked\n ```mermaid \n %%{init: { 'theme':'dark', 'sequence': {'useMaxWidth':false} } }%%\n sequenceDiagram \n alice ->> mark: Sent a flower\n ```"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Difference between git pull and git pull origin master [duplicate]\n\nThis question already has answers here:\n \n \n\n\n\n\nDifferences between \"git pull\" commands when pulling from origin?\n\n (2 answers)\n \n\nClosed 10 years ago.\n\n\n\nWhat is the difference between these two commands?\ngit pull\n\nand \ngit pull origin master"
},
{
"role": "assistant",
"content": "[Edit, May 2018: git pull is no longer a shell script and a few details are different in modern Git. Pull also now has recursion options that make it more useful with submodules. This answer ignores the submodules.]\nThe git pull script is meant as a convenience method for invoking git fetch followed by git merge (or, with git pull --rebase, invoking git fetch followed by git rebase).\nThe first extra argument to git pull tells it which remote to give to the fetch operation:\ngit pull origin\n\nfor example, means to fetch from origin. If you leave this out, Git uses the current branch's remote:\n$ git branch\n* master\n$ git config --get branch.master.remote\norigin\n\nThe second (and any additional) arguments to git pull tell it which branch or branches to merge in. These are the names of the branches as found on the remote. For instance, suppose you create a new branch feature2 that tracks origin/feature:\n$ git checkout -b feature2 origin/feature\n\nIf you now want to fetch from origin to pick up new commits added to their feature branch, but merge them in to your local feature2 branch:\n$ git pull origin feature\n\nIf you leave out the branch name(s), git uses the current branch's merge:\n$ git config --get branch.feature2.merge\nfeature\n\nNote that if you list multiple branch names, Git will do an \"octopus merge\". In my experience, this usually surprises people the first time: they think git pull remote br1 br2 will run git fetch followed by a series of separate git merge-s on each branch, but that's not what happens."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs --inter-hunk-context=<lines>"
},
{
"role": "assistant",
"content": "Show the context between diff hunks, up to the specified number\nof lines, thereby fusing hunks that are close to each other.\nDefaults to diff.interHunkContext or 0 if the config option\nis unset."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I delete (or merge) a local Git branch that I'm currently on?\nI'm pretty new to using git, and I use it to contribute to the AOKP Android ROM. I've successfully created a few branches, modified the code, and uploaded the commits that have gotten merged on the remote end. But in my local repository, those branches are still showing up (even though they show up as having no changes). The problem is that when I created those branches, I did so right from the subfolder that needed to be modified, so I don't have any \"higher\" branches to go to. And because of that, I can't delete those branches -- git tels me error: Cannot delete the branch 'MyMods' which you are currently on.\nSo what can I do to get rid of those branches?"
},
{
"role": "assistant",
"content": "Checkout a different branch first, before deleting it:\ngit checkout master\ngit branch -d MyMods\n\nAlso, branches have nothing to do with folders. Git always tracks the whole repository at once, with all its folders and files. A branch is nothing else than a pointer to a single commit, or snapshot, in the history of the repository."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I switch a public repo to private and vice versa on GitHub?\n\nI can't seem to find a way to do this. Is it possible at all? Since this is kind of important in my case, is there a code management platform where this is possible?"
},
{
"role": "assistant",
"content": "Instead of switching back and forth between GitHub repository visibility status (which is possible through the repository settings, section \"danger zone\"), I would rather establish 2 repositories:\n\none public, with only public content\none private, with a mix of public and private content\n\nThat way, you don't have to wonder, when pushing to a repository, if it is today public or private: you would push to one specific repository (of the two), knowing full well its visibility status.\nAnd you would never expose private content, which, is set to public even a few minutes, ... is no longer ever truly private (because it can be cloned, replicated and pushed elsewhere)\n\nThat being said, since June 2020, you have an \"Updated UI for Changing Repository Visibility \":\n\nYou can now set your repository to any available visibility option – public, private, or internal – from a single dialog in the repository's settings.\nPreviously, you had to navigate separate sections, buttons, and dialog boxes for changing between public and private, and between private and internal.\n\nSee \"Setting repository visibility\"\n\n(*) \"destructuve action\" because of the consequences of the visibility change:\n\npublic to private: some features won't be available in the repository after you change the visibility to private. Any published GitHub Pages site will be automatically unpublished.\nGitHub Advanced Security features, such as code scanning, will stop working\n\nprivate to public: GitHub will detach private forks and turn them into a standalone private repository\n\n\n\nNote that, since July 10th 2020, the default visibility is private:\n\nDefault visibility for new repositories\n\n\nWhen you create a repository, you can choose whether it should be private or public.\nNow, when you're signed into GitHub through an organization's single sign on service and create a new repository through the website navigation, the default selection is Private.\nThis helps prevent sensitive company data from unintentionally being pushed to public repositories. See the about repository visibility article for more information about this choice."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I rollback a git repository to a specific commit?\nMy repo has 100 commits in it right now. I need to rollback the repository to commit 80, and remove all the subsequent ones.\nWhy?\nThis repo is supposed to be for merging from miscellaneous users. A bunch of merges went in as commits from me, due to excessive editing. That was due to a mislabeling of my remote branches, where 3 developers were labeled as each other. I need to reset to that point, and then pull forwards.\nI wanted to rebase, as in this example: How can I remove a commit on GitHub?\nHowever, git wants me to do a lot of conflict management. Is there a simpler way?"
},
{
"role": "assistant",
"content": "git reset --hard <old-commit-id>\ngit push -f <remote-name> <branch-name>\n\nNote: As written in comments below, Using this is dangerous in a collaborative environment: you're rewriting history"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker EMAIL"
},
{
"role": "assistant",
"content": "The email address used in the author and committer identities if no other\nrelevant environment variable or configuration setting has been set."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Mainline parent number when cherry picking merge commits\nSuppose this is my git history\n\n Z\n /\nA -- C -- D\n \\ / \n B\n\nMy HEAD is currently at Z. I want to cherry-pick B and C. If my understanding is correct, I should do this:\ngit cherry-pick B\ngit cherry-pick C -m 1\ngit commit --allow-empty\n\nIt worked in my case because C is a no-op (hence the empty commit afterwards, I needed the commit for other reasons), but I am wondering what the parameter after -m does. Here is what I read from the docs:\n\n-m parent-number\n--mainline parent-number\nUsually you cannot cherry-pick a merge because you do not know which side of the merge should be considered the mainline. This option specifies the parent number (starting from 1) of the mainline and allows cherry-pick to replay the change relative to the specified parent.\n\nIn my case, C has two parents but how do I know which one is 1 and 2, and more importantly when does it matter when I pick 1 or 2?"
},
{
"role": "assistant",
"content": "My understanding based off this answer is that parent 1 is the branch being merged into, and parent 2 is the branch being merged from. So in your case, parent 1 is A, and parent 2 is B. Since a cherry-pick is really applying the diff between two commits, you use -m 1 to apply only the changes from B (because the diff between A and C contains the changes from B). In your case, it probably doesn't matter, since you have no commits between A and C.\nSo yes, -m 1 is what you want, and that is true even if there were extra commits between A and C.\nIf you want to make the new history look a little more like the original history, there's another way to do this:\ngit cherry-pick B\ngit checkout Z\ngit merge --no-ff --no-commit B\ngit commit --author=\"Some Dev <[email protected]>\" --date=\"<commit C author date>\"\n\n(If needed, you can create a new branch for B before cherry-picking.)\nThis will retain the author information, should give you a history that looks like this:\n B'\n / \\\n Z -- C'\n /\nA -- C -- D\n \\ / \n B"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc"
},
{
"role": "assistant",
"content": "other diff formats The --summary option describes newly added, deleted, renamed and\ncopied files. The --stat option adds diffstat(1) graph to the\noutput. These options can be combined with other options, such as -p , and are meant for human consumption. When showing a change that involves a rename or a copy, --stat output\nformats the pathnames compactly by combining common prefix and suffix of\nthe pathnames. For example, a change that moves arch/i386/Makefile to arch/x86/Makefile while modifying 4 lines will be shown like this: arch/{i386 => x86}/Makefile | 4 +-- The --numstat option gives the diffstat(1) information but is designed\nfor easier machine consumption. An entry in --numstat output looks\nlike this: 1\t2\tREADME\n3\t1\tarch/{i386 => x86}/Makefile That is, from left to right: the number of added lines; a tab; the number of deleted lines; a tab; pathname (possibly with rename/copy information); a newline. When -z output option is in effect, the output is formatted this way: 1\t2\tREADME NUL\n3\t1\tNUL arch/i386/Makefile NUL arch/x86/Makefile NUL That is: the number of added lines; a tab; the number of deleted lines; a tab; a NUL (only exists if renamed/copied); pathname in preimage; a NUL (only exists if renamed/copied); pathname in postimage (only exists if renamed/copied); a NUL. The extra NUL before the preimage path in renamed case is to allow\nscripts that read the output to tell if the current record being read is\na single-path record or a rename/copy record without reading ahead.\nAfter reading added and deleted lines, reading up to NUL would yield\nthe pathname, but if that is NUL , the record will show two paths."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I see which Git branches are tracking which remote / upstream branch?\nI know I can do git branch --all, and that shows me both local and remote branches, but it's not that useful in showing me the relationships between them.\nHow do I list branches in a way that shows which local branch is tracking which remote?"
},
{
"role": "assistant",
"content": "Very much a porcelain command, not good if you want this for scripting:\ngit branch -vv # doubly verbose!\n\nNote that with git 1.8.3, that upstream branch is displayed in blue (see \"What is this branch tracking (if anything) in git?\")\n\nIf you want clean output, see Carl Suster's answer - it uses a porcelain command that I don't believe existed at the time I originally wrote this answer, so it's a bit more concise and works with branches configured for rebase, not just merge."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Branching and merging best practices in Git\nWe have a developer team of 4 and have recently moved to Git. We want to learn best practices regarding workflow with branching and merging. \nWe are using a lightweight version of Git Flow. We have a dev, staging and a master branch which are all linear with each other. \n\nstaging is branched from master\ndev is branched from staging\n\nOn top of that we use feature and hotfix branches to work on new features and fix bugs. \nI have the following questions:\n\nShould we branch feature branches from dev or from master? \nWhen a feature branch is ready, should we merge the feature branch into dev, then merge dev into staging, or merge the feature branch into staging and then the feature branch into master?\n\nI think we should branch from master and merge the feature branch up, because there might be something in dev that we might not want to merge to staging and master.\nWhat is your opinion? What are the best practices?"
},
{
"role": "assistant",
"content": "While Git Flow is an excellent branching model, the questions you are asking are a symptom of a bigger problem: Git Flow is too heavy for a small team working on a consumer web product (I am making an assumption that you are working on consumer web product, feel free to ignore if you are coding nuclear power plant control room). \nI would like to encourage you to consider Continuous Deployment (CD) with an extremely simple branching model:\n\nIt is very easy to setup CD nowadays:\n\nUse Travis, CodeShip, Jenkins or similar system to run a full build and test suite on every commit pushed on every branch of your codebase\nSetup Travis/Codeship/Jenkins to deploy to production every commit to master that passes the tests. \nCreate a new branch from master for every new feature. \nCode a new feature and test it on a branch.\nMerge a feature branch into master, and watch it go live. \n\nThere are a lot of common objections to it, that all can be summarized as \"but what if I introduce a bug?!\". The answer is \"You'll fix it!\". If you write tests, if you monitor your production site, if you do code reviews, if you practice pair programming, if you use feature flags, and if you keep your features small, then the benefits you get from CD will outweigh the occasional problems any day. \nI encourage you to try. It will free your mind to focus on what truly matters: building a great product! If you do not believe me, take a look at this excellent presentation from Github."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "clojure and leiningen - using a git repository as dependency\n\nIs it possible to have leiningen pull a project directly from a git repository (on github) as a dependency?\nUsing Bundler with Ruby, it is possible to map a gem to a git repo, allowing for rapid development and integration of dependent projects.\nUpdate \nBased on the accepted answer, there is now a leiningen plugin for managing git-deps:\nhttps://github.com/tobyhede/lein-git-deps"
},
{
"role": "assistant",
"content": "I just found this in clojurescriptone's project.clj\nI think it maybe helpful to you:\n:git-dependencies [[\"https://github.com/clojure/clojurescript.git\"\n \"886d8dc81812962d30a741d6d05ce9d90975160f\"]\n [\"https://github.com/levand/domina.git\"\n \"8933b2d12c44832c9bfaecf457a1bc5db251a774\"]]\n\nThe file is here."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to determine if GitLab installation is Omnibus or via source?\n\nI'm researching the process of migrating GitLab from an old server to a new server. One of the first things I need to do is determine which installation GitLab is in (Omnibus vs. source), and I'm unable to tell. \nThis post (omnibus or source - can't decide which one to use for gitllab backup/restore) mentions looking for a .git file in the GitLab root folder (/home/git/gitlab) - I don't see a .git file there. So, by that comment the installation was Omnibus.\nHowever, looking at this post (Checking of GitLab version), I'm unable to run: \nsudo gitlab-rake gitlab:env:info (shown for Omnibus installation)\nBut I can run: \nbundle exec rake gitlab:env:info RAILS_ENV=production (shown for source installation)\nI'm seeing conflicting answers. How can I tell which installation GitLab is in? \nIn any case, when I run the last command, I get the following results (if it helps): \n\nSystem information\n System: Debian 7.10\n Current User: git\n Using RVM: no\n Ruby Version: 2.0.0p247\n Gem Version: 2.0.3\n Bundler Version:1.7.2\n Rake Version: 10.1.0\nGitLab information\n Version: 6.0.2\n Revision: 10b0b8f\n Directory: /home/git/gitlab\n DB Adapter: mysql2\n URL: http://107.178.218.39\n HTTP Clone URL: http://107.178.218.39/some-project.git\n SSH Clone URL: [email protected]:some-project.git\n Using LDAP: no\n Using Omniauth: no\nGitLab Shell\n Version: 1.7.0\n Repositories: /home/git/repositories/\n Hooks: /home/git/gitlab-shell/hooks/\n Git: /usr/bin/git"
},
{
"role": "assistant",
"content": "You should Check this file is available: \n/etc/gitlab/gitlab.rb\nIf not then it installed from source. My advice is to change your install to a omnibus install, it makes it much easier to upgrade.\nRead this for more info about upgrading to omnibus installation: https://docs.gitlab.com/omnibus/update/README.html#upgrading-from-a-non-omnibus-installation-to-an-omnibus-installation\nUpdate 1\n\nNote if MySQL is used as a database you have to do a conversion see the documentation https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/mysql_to_postgresql.md\n\nTo upgrade a installation from source, you have 2 options:\n\nMake sure you have an omnibus-gitlab package matching your current GitLab version. (If possible I would upgrade for the last time from source)\n\n1. Install gitlab with omnibus on the same server. \n\nBefore you begin, make a snapshot from the server to be sure you can always return to a working point. Also make sure the shutdown gitlab.\n\nYou should install gitlab by using the omnibus option:\nsudo apt-get install curl openssh-server ca-certificates postfix\ncurl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash sudo apt-get install gitlab-ce\n\nThe omnibus en the source install can be installed at the same time on the server. You can always change back yo the source install if something goes wrong.\nThen following the instruction in the documentation: https://docs.gitlab.com/omnibus/update/README.html#upgrading-from-non-omnibus-postgresql-to-an-omnibus-installation-in-place\n2. Install gitlab by backup. \nWhen you use a backup you can even transfer you gitlab installation to a new server. I used this way, and it was very easy.\n\nBefore you make your backup, shutdown gitlab so you can be sure there is nothing changed between your backup and restore process\n\nTo start, make a backup:\nsudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production\nSee also the documenation this coverage to much info to put here.\nAfter that you can move you backup to the new gitlab server or use it later to import it.\nTo import it in the omnibus install (in short, but read the documentation):\nsudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/\nsudo gitlab-ctl stop unicorn\nsudo gitlab-ctl stop sidekiq\n# Verify\nsudo gitlab-ctl status\n\nsudo gitlab-rake gitlab:backup:restore BACKUP=1393513186\n\nsudo gitlab-ctl start\nsudo gitlab-rake gitlab:check SANITIZE=true\n\nSince you say it is about a live environment. You can do the following, setup a tiny server/ or on you local machine to do upgrade the process so you feel comfortable with it. After that you can do the same on the live env."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git commit -m vs. git commit -am\nSeems easy but I just don't get it. I am in the root of my application.\nHere is my workflow.\ngit add .\ngit commit -m \"added a new feature some files changed\"\ngit push heroku master\n\nThis usually works. All my changes are pushed.\nBut sometimes I have a file that I change but when I push to Heroku the changes are not there for THAT ONE FILE... but for most of the files the changes are there... \nBut if I do\ngit add .\ngit commit -am \"added a new feature some files changed\"\ngit push heroku master\n\nEverything (all changes) are pushed to Heroku"
},
{
"role": "assistant",
"content": "From the docs:\n\ngit commit -a automatically stage all tracked, modified files before the commit If you think the git add stage of the workflow is\n too cumbersome, Git allows you to skip that part with the -a option.\n This basically tells Git to run git add on any file that is \"tracked\"\n - that is, any file that was in your last commit and has been modified. This allows you to do a more Subversion style workflow if\n you want, simply editing files and then running git commit -a when you\n want to snapshot everything that has been changed. You still need to\n run git add to start tracking new files, though, just like Subversion.\n\nUsing the option -am allows you to add and create a message for the commit in one command."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to create a Gitlab webhook to update a mirror repo on Github?\n\nI would like to create a webhook within Gitlab to automatically update a mirror repository on Github, whenever a push event happens. I've checked this page, but I didn't understand how it is done.\nMy Gitlab version is 6.5. Here is the configuration page:\n\nWhat should I put in URL? Where do I need to place the script to update the repository?"
},
{
"role": "assistant",
"content": "You don't need a webhook for that. A regular post-receive hook will work very well.\nTo create and use such a hook you just have to login on the server where your gitlab is installed and create an ssh key for git user.\nsudo -u git ssh-keygen -f /home/git/.ssh/reponame_key\n\n(do not type any passphrase when prompted)\nGo to your github account and add the public key (it's been created as /home/git/ssh/reponame_key.pub) to your project as a deploy key.\nhave a look at https://help.github.com/articles/managing-deploy-keys if you need help with that.\nOnce that is done, you just have to configure the connection between your git server and github's:\nadd an alias to git user's ssh configuration (add following lines to /home/git/.ssh/config - create it if it's not present)\nHost reponame \nIdentityFile /home/git/.ssh/reponame_key \nHostName github.com \nUser git \n\nNow add the new remote (using the alias you just created) to your repository:\ncd /home/git/repositories/namespace/reponame.git\n\ngit remote add --mirror github reponame:youruser/reponame.git\n\nNow that everything is in place you'll have to create the actual hook:\ncd /home/git/repositories/namespace/reponame.git/hooks\n\necho \"exec git push --quiet github &\" >> post-receive\n\nchmod 755 post-receive\n\nThe lastcommand is very important because git will check if a hook is executable before running it.\nThat's it!\n(Replace reponame, namespace and youruser according to your real accounts and enjoy).\nLast note: if you want your name andavatar near commits on github, make sure that the email address you are using on gitlab is one of the addresses inked to your github account as well. You'll see your gitlab username otherwise."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-archive - Create an archive of files from a named tree git archive --format=tar.gz --prefix=git-1.4.0/ v1.4.0 >git-1.4.0.tar.gz"
},
{
"role": "assistant",
"content": "Same as above, but using the builtin tar.gz handling."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to fix a permission denied (publickey) error for a git submodule update in the Github Travis CI build?\n\nI cannot update the git submodule, with the error:\n$ git submodule init\nSubmodule 'build/html' ([email protected]:quadroid/clonejs.git) registered for path 'build/html'\n...\n$ git submodule update\nCloning into 'build/html'...\nWarning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.\nPermission denied (publickey).\nfatal: Could not read from remote repository.\n\nBut when I do the same tasks locally, everything is OK.\nHow do I fix this so that the Travis CI build passes and I can still click on the submodule in the repo to direct to it?"
},
{
"role": "assistant",
"content": "This can (thankfully) be easily solved by modifying the .gitmodules file on-the-fly on Travis, so that the SSH URL is replaced with the public URL, before initializing submodules. To accomplish this, add the following to .travis.yml:\n# Handle git submodules yourself\ngit:\n submodules: false\n# Use sed to replace the SSH URL with the public URL, then initialize submodules\nbefore_install:\n - sed -i 's/[email protected]:/https:\\/\\/github.com\\//' .gitmodules\n - git submodule update --init --recursive\n\nThanks to Michael Iedema for his gist from which I derived this solution.\nIf your submodules are private repositories, it should work to include credentials in the https URLs, I recommend making a GitHub access token with restricted permissions for this purpose:\n# Replace <user> and <token> with your GitHub username and access token respectively\n- sed -i 's/[email protected]:/https:\\/\\/<user>:<token>@github.com\\//' .gitmodules"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-send-email - Send a collection of patches as emails --batch-size=<num>"
},
{
"role": "assistant",
"content": "Some email servers (e.g. smtp.163.com) limit the number emails to be\nsent per session (connection) and this will lead to a failure when\nsending many messages. With this option, send-email will disconnect after\nsending $<num> messages and wait for a few seconds (see --relogin-delay)\nand reconnect, to work around such a limit. You may want to\nuse some form of credential helper to avoid having to retype\nyour password every time this happens. Defaults to the sendemail.smtpBatchSize configuration variable."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitignore won't ignore .vs folder\nWe've tried all sorts of explicit and wildcard entries in .gitignore however items in the hidden .vs folder as a part of Visual Studio keep getting committed.\nSince those are individual settings for developers, they are obviously always different and show up in a git diff.\nHow can I resolve it to ignore everything in the top-level .vs folder in the repo?"
},
{
"role": "assistant",
"content": "Follow the steps below, the issue will be solved.\nStep 1: Add following content to the file .gitignore.\n\n\n## Ignore Visual Studio temporary files, build results, and\r\n## files generated by popular Visual Studio add-ons.\r\n\r\n# User-specific files\r\n*.suo\r\n*.user\r\n*.userosscache\r\n*.sln.docstates\r\n\r\n# User-specific files (MonoDevelop/Xamarin Studio)\r\n*.userprefs\r\n\r\n# Build results\r\n[Dd]ebug/\r\n[Dd]ebugPublic/\r\n[Rr]elease/\r\n[Rr]eleases/\r\nx64/\r\nx86/\r\nbld/\r\n[Bb]in/\r\n[Oo]bj/\r\n[Ll]og/\r\n\r\n# Visual Studio 2015 cache/options directory\r\n.vs/\r\n# Uncomment if you have tasks that create the project's static files in wwwroot\r\n#wwwroot/\r\n\r\n# MSTest test Results\r\n[Tt]est[Rr]esult*/\r\n[Bb]uild[Ll]og.*\r\n\r\n# NUNIT\r\n*.VisualState.xml\r\nTestResult.xml\r\n\r\n# Build Results of an ATL Project\r\n[Dd]ebugPS/\r\n[Rr]eleasePS/\r\ndlldata.c\r\n\r\n# DNX\r\nproject.lock.json\r\nartifacts/\r\n\r\n*_i.c\r\n*_p.c\r\n*_i.h\r\n*.ilk\r\n*.meta\r\n*.obj\r\n*.pch\r\n*.pdb\r\n*.pgc\r\n*.pgd\r\n*.rsp\r\n*.sbr\r\n*.tlb\r\n*.tli\r\n*.tlh\r\n*.tmp\r\n*.tmp_proj\r\n*.log\r\n*.vspscc\r\n*.vssscc\r\n.builds\r\n*.pidb\r\n*.svclog\r\n*.scc\r\n\r\n# Chutzpah Test files\r\n_Chutzpah*\r\n\r\n# Visual C++ cache files\r\nipch/\r\n*.aps\r\n*.ncb\r\n*.opendb\r\n*.opensdf\r\n*.sdf\r\n*.cachefile\r\n\r\n# Visual Studio profiler\r\n*.psess\r\n*.vsp\r\n*.vspx\r\n*.sap\r\n\r\n# TFS 2012 Local Workspace\r\n$tf/\r\n\r\n# Guidance Automation Toolkit\r\n*.gpState\r\n\r\n# ReSharper is a .NET coding add-in\r\n_ReSharper*/\r\n*.[Rr]e[Ss]harper\r\n*.DotSettings.user\r\n\r\n# JustCode is a .NET coding add-in\r\n.JustCode\r\n\r\n# TeamCity is a build add-in\r\n_TeamCity*\r\n\r\n# DotCover is a Code Coverage Tool\r\n*.dotCover\r\n\r\n# NCrunch\r\n_NCrunch_*\r\n.*crunch*.local.xml\r\nnCrunchTemp_*\r\n\r\n# MightyMoose\r\n*.mm.*\r\nAutoTest.Net/\r\n\r\n# Web workbench (sass)\r\n.sass-cache/\r\n\r\n# Installshield output folder\r\n[Ee]xpress/\r\n\r\n# DocProject is a documentation generator add-in\r\nDocProject/buildhelp/\r\nDocProject/Help/*.HxT\r\nDocProject/Help/*.HxC\r\nDocProject/Help/*.hhc\r\nDocProject/Help/*.hhk\r\nDocProject/Help/*.hhp\r\nDocProject/Help/Html2\r\nDocProject/Help/html\r\n\r\n# Click-Once directory\r\npublish/\r\n\r\n# Publish Web Output\r\n*.[Pp]ublish.xml\r\n*.azurePubxml\r\n# TODO: Comment the next line if you want to checkin your web deploy settings \r\n# but database connection strings (with potential passwords) will be unencrypted\r\n*.pubxml\r\n*.publishproj\r\n\r\n# NuGet Packages\r\n*.nupkg\r\n# The packages folder can be ignored because of Package Restore\r\n**/packages/*\r\n# except build/, which is used as an MSBuild target.\r\n!**/packages/build/\r\n# Uncomment if necessary however generally it will be regenerated when needed\r\n#!**/packages/repositories.config\r\n# NuGet v3's project.json files produces more ignoreable files\r\n*.nuget.props\r\n*.nuget.targets\r\n\r\n# Microsoft Azure Build Output\r\ncsx/\r\n*.build.csdef\r\n\r\n# Microsoft Azure Emulator\r\necf/\r\nrcf/\r\n\r\n# Windows Store app package directories and files\r\nAppPackages/\r\nBundleArtifacts/\r\nPackage.StoreAssociation.xml\r\n_pkginfo.txt\r\n\r\n# Visual Studio cache files\r\n# files ending in .cache can be ignored\r\n*.[Cc]ache\r\n# but keep track of directories ending in .cache\r\n!*.[Cc]ache/\r\n\r\n# Others\r\nClientBin/\r\n~$*\r\n*~\r\n*.dbmdl\r\n*.dbproj.schemaview\r\n*.pfx\r\n*.publishsettings\r\nnode_modules/\r\norleans.codegen.cs\r\n\r\n# Since there are multiple workflows, uncomment next line to ignore bower_components \r\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\r\n#bower_components/\r\n\r\n# RIA/Silverlight projects\r\nGenerated_Code/\r\n\r\n# Backup & report files from converting an old project file\r\n# to a newer Visual Studio version. Backup files are not needed,\r\n# because we have git ;-)\r\n_UpgradeReport_Files/\r\nBackup*/\r\nUpgradeLog*.XML\r\nUpgradeLog*.htm\r\n\r\n# SQL Server files\r\n*.mdf\r\n*.ldf\r\n\r\n# Business Intelligence projects\r\n*.rdl.data\r\n*.bim.layout\r\n*.bim_*.settings\r\n\r\n# Microsoft Fakes\r\nFakesAssemblies/\r\n\r\n# GhostDoc plugin setting file\r\n*.GhostDoc.xml\r\n\r\n# Node.js Tools for Visual Studio\r\n.ntvs_analysis.dat\r\n\r\n# Visual Studio 6 build log\r\n*.plg\r\n\r\n# Visual Studio 6 workspace options file\r\n*.opt\r\n\r\n# Visual Studio LightSwitch build output\r\n**/*.HTMLClient/GeneratedArtifacts\r\n**/*.DesktopClient/GeneratedArtifacts\r\n**/*.DesktopClient/ModelManifest.xml\r\n**/*.Server/GeneratedArtifacts\r\n**/*.Server/ModelManifest.xml\r\n_Pvt_Extensions\r\n\r\n# Paket dependency manager\r\n.paket/paket.exe\r\npaket-files/\r\n\r\n# FAKE - F# Make\r\n.fake/\r\n\r\n# JetBrains Rider\r\n.idea/\r\n*.sln.iml\n\n\n\nStep 2: Make sure above operation take effect\nIf the issue still exists, that's because settings in .gitignore can only ignore files that were originally not tracked. If some files have already been included in the version control system, then modifying .gitignore is invalid.\nTo solve this issue completely, you need to open Git Bash running following commands in the repository root folder.\n\n\n$ git rm -r --cached .\r\n$ git add .\r\n$ git commit -m 'Update .gitignore'\n\n\n\nCertainly, you can also use Package Manager Console of Visual Studio to do the things in Step 2.\n\nThen the issue will be completely solved."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-reset - Reset current HEAD to the specified state git reset (--patch | -p) [<tree-ish>] [--] [<pathspec>…]"
},
{
"role": "assistant",
"content": "Interactively select hunks in the difference between the index\nand <tree-ish> (defaults to HEAD ). The chosen hunks are applied\nin reverse to the index. This means that git reset -p is the opposite of git add -p , i.e.\nyou can use it to selectively reset hunks. See the “Interactive Mode”\nsection of git-add to learn how to operate the --patch mode."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --output-indicator-new=<char> --output-indicator-old=<char> --output-indicator-context=<char>"
},
{
"role": "assistant",
"content": "Specify the character used to indicate new, old or context\nlines in the generated patch. Normally they are + , - and\n' ' respectively."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to add a GitHub personal access token to Visual Studio Code\n\nI received an email saying GitHub will require token authentication after August 13 2021. I want to ensure I don't have an interruption of service (push/pull) after this date.\nSo I logged into GitHub and created a token for my single repository.\nNow I want to use the token to push/pull my repository from GitHub, in Visual Studio Code, which uses Git and the command line, which I have installed on my Mac.\nWhat do I do to add/replace the password from GitHub with the generated token I just created to push/pull from my repository? Can I do it from Visual Studio Code or does it get added from the terminal command line?"
},
{
"role": "assistant",
"content": "Follow these simple steps to set up GitHub authentication with a personal access token:\n\nOpen a command line window on your PC or Terminal on Mac\n\nSet the current directory to your project root\ncd C:\\Users\\Giddy\\source\\repo\\MySampleProject\n\n\nRun the command to set remote access via a token\ngit remote set-url origin https://username:[email protected]/username/repository.git\n\nExample:\ngit remote set-url origin https://sampleuser:a7b19929***[email protected]/sampleuser/sampleproject.git"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the difference between global and local configuration in git?\nI am a beginner to Git. I go through the internet and find those.\nWhat I know are \n\nLocal -: Values in this file apply to a single repository. \nGlobal -: Configuration values in this file are applied to a single user.\n\nCan I know any other differences between these configurations?"
},
{
"role": "assistant",
"content": "Git comes with a tool called git config that lets you configure variables that control all the aspects of how git will operate.\ngit config holds its value between upgrades. So, you need to set it only once.\nBasically, there are 3 places to store these variables:\n\nSystem.\nGlobal.\nLocal.\n\n\n1. System: These variables are available for every user in the system and stored in\n[path]/etc/gitconfig. \nExample: C:/Program Files/Git/etc/gitconfig\nYou can make git read and write from System by passing --system as option. It also requires you to have administration permissions.\n\n2. Global: Global configurations are available for the current user for all the projects and stored in\n~/.gitconfig or ~/.config/git/config \nExample: C:/Users/Username/.gitconfig\nYou can make git to read and write from Global by passing --global option.\n\n3. Local: Local configs are available for the current repository only and stored in\n[gitrepo]/.git/config\nExample: C:/Users/MyProject/.git/config\nYou can make git read and write from Local by passing --local option.\n\nExample:\nCreate a local config\n$ git config --local user.name \"Local User\"\n\n# Create a global config\n$ git config --global user.name \"Global User\"\n\n# Create a system config\n$ sudo git config --system user.name \"System User\"\n\nto verify the origin of your configuration :\ngit config --list --show-origin\n\nAlso, its important to remember each level overrides values the previous level.\nPriority:\nLocal > Global > System"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "remove a file from GIT control [duplicate]\n\nThis question already has answers here:\n \n \n\n\n\nClosed 12 years ago.\n\n\n\n\nPossible Duplicate:\ngit - removing a file from source control (but not from the source) \n\nI have a .classpath file which is currently in GIT repository.\nAfter I pulled from remove repository(git pull origin master). How can I remove this file from GIT control, I mean NOT to delete this file from my computer but remove it from GIT version control. (Because this file is not needed for version control).\nP.S.\nI tried git rm <path-to>/.classpath , but then my whole project complains about wrong class path, why git rm delete my file instead of remove from version control ???"
},
{
"role": "assistant",
"content": "Use git rm --cached to remove from the index but not the working tree.\nAfter that, you should add .classpath to your .gitignore file, to prevent it from being committed again."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-apply"
},
{
"role": "assistant",
"content": "Apply a patch to files and/or to the index"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to know who is the maintainer of a GitHub repository?\n\nIs there a way to know which people have merge privileges on a public GitHub repository. If the owner is a user and not an organization, then at least I know one maintainer, but it's possible that there are other users with merge rights. Also, if the owner is an organization it is possible, that not all members of the organization have merge rights. So is there a way to find the exact maintainers?"
},
{
"role": "assistant",
"content": "Team privileges are not public in general. Even an organization-membership is not public since the publicity must be chosen by the given member, as the Documentation states:\n\nBy default, your organization membership visibility is set to private. You can choose to publicize individual organization memberships on your profile.\n\nThis partly applies for their implementation of CODEOWNERS, too. If it is up to date the given source file is annotated with a link to its responsible GitHub user.\n\nHowever there's normally no need to know the individual maintainers of a repository (since every interaction with repos you're able to access is covered by the GitHub UI, which also assures that somebody takes care about your request). If your attention is about a public repository you might search the commits for accepted pull-request. But in that case you would preferably fork the repo and just generate pull-requests on your own.\nYou are even not able to contact an organization via GitHub - try to find their official website, contact them and ask for their maintainers if you need that information."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to DEFLATE with a command line tool to extract a git object?\nI'm looking for a command line wrapper for the DEFLATE algorithm.\nI have a file (git blob) that is compressed using DEFLATE, and I want to uncompress it. The gzip command does not seem to have an option to directly use the DEFLATE algorithm, rather than the gzip format.\nIdeally I'm looking for a standard Unix/Linux tool that can do this.\nedit: This is the output I get when trying to use gzip for my problem:\n$ cat .git/objects/c0/fb67ab3fda7909000da003f4b2ce50a53f43e7 | gunzip\n\ngzip: stdin: not in gzip format"
},
{
"role": "assistant",
"content": "You can do this with the OpenSSL command line tool:\nopenssl zlib -d < $IN > $OUT\n\nUnfortunately, at least on Ubuntu, the zlib subcommand is disabled in the default build configuration (--no-zlib --no-zlib-dynamic), so you would need to compile openssl from source to use it. But it is enabled by default on Arch, for example.\nEdit: Seems like the zlib command is no longer supported on Arch either. This answer might not be useful anymore :("
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "pause git clone and resume later? [duplicate]\nThis question already has answers here:\n \n \n\n\n\n\nHow to complete a git clone for a big project on an unstable connection?\n\n (19 answers)\n \n\nClosed 10 years ago.\n\n\n\nIs there a way to pause git clone and resume it later? I'm cloning a really big repo (around 2GB) and my PC's been turned on for more than 40 hours. I have school to catch later, I don't want to leave it like this. Anybody got an idea? It's already at 67% btw. :("
},
{
"role": "assistant",
"content": "Depending on your situation (e.g. if you want to close your laptop and / or switch networks), stopping the process (using Ctrl-Z) and resuming it (using fg) might work for you."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker --no-lazy-fetch"
},
{
"role": "assistant",
"content": "Do not fetch missing objects from the promisor remote on\ndemand. Useful together with git cat-file -e <object> to\nsee if the object is locally available.\nThis is equivalent to setting the GIT_NO_LAZY_FETCH environment variable to 1 ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-help - Display help information about Git --developer-interfaces"
},
{
"role": "assistant",
"content": "Print a list of file formats, protocols and other developer\ninterfaces documentation on the standard output."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-parse - Pick out and massage parameters REBASE_HEAD"
},
{
"role": "assistant",
"content": "during a rebase, records the commit at which the operation is\ncurrently stopped, either because of conflicts or an edit command in\nan interactive rebase."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-request-pull - Generates a summary of pending changes <end>"
},
{
"role": "assistant",
"content": "Commit to end at (defaults to HEAD). This names the commit\nat the tip of the history you are asking to be pulled. When the repository named by <URL> has the commit at a tip of a\nref that is different from the ref you have locally, you can use the <local>:<remote> syntax, to have its local name, a colon : , and\nits remote name."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --src-prefix=<prefix>"
},
{
"role": "assistant",
"content": "Show the given source prefix instead of \"a/\"."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-pull - Fetch from and integrate with another repository or a local branch find-renames[=<n>]"
},
{
"role": "assistant",
"content": "Turn on rename detection, optionally setting the similarity\nthreshold. This is the default. This overrides the merge.renames configuration variable.\nSee also git-diff --find-renames ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Differencies between git add and git stage command\nWhat is the difference between git add filename and git stage filename? Because when I tried them both it looks that they do the same thing."
},
{
"role": "assistant",
"content": "As the documentation says, git stage is just a synonym for git add, so there is no difference in usage."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "In Xcode 4 how do I add a remote GitHub repository to an existing local project?\n\nThe Git integration in Xcode 4 is very welcome however it seems to be a bit flaky when it comes to dealing with remote repositories.\nFor clarity I'm using OS X version 10.6.7 and Xcode 4.0.2 (4A2002a). \nIf I create a new Xcode 4 Project and accept the option to create a local Git repository, all is well. I can commit locally and that's great.\nWhen I want to push the new project to GitHub I want to add a remote repository and push my local changes up to GitHub. I can add a GitHub repository to Xcode 4 as a new Repository in the Organizer window but there's no method of setting it as a remote repository for my existing project. \nSo I switch to using git commands in Terminal.\ngit remote add origin https://<username>@github.com/<organization>/<repository>.git\n\nIf I then go back to Xcode 4 and try to use \n\nFile -> Source Control -> Push... \n\nthen the Choose the repository to which to push changes. dialog appears listing the origin remote repository. There's a yellow indicator saying that Authentication is required, which is fine as I've not been able to enter my credentials yet for HTTPS. \nHowever when I click 'Push' and it tries to push the changes it says \"The operation could not be performed because access to the repository 'origin' is denied.\"\nA dialog prompting me for my username and password then appears with my pre-filled out so it must be reading this correctly from the local repository's config.\nWhen I enter my password Xcode 4 then crashes with the following error\nASSERTION FAILURE in /SourceCache/IDEKit/IDEKit-303/Framework/Classes/SourceControl/IDESourceControlOperationInfo.m:59\nDetails: Message sent to invalidated object: <IDESourceControlPushOperationInfo, 0x200bd2a80>. Backtrace for invalidation:\n (null)\nObject: <IDESourceControlPushOperationInfo: 0x200bd2a80>\nMethod: -invalidate\nThread: <NSThread: 0x200020700>{name = (null), num = 1}\nHints: None\n\nIf I restart Xcode an origin repository has been added to the Repositories browser in Organizer and I can see the master branch on GitHub so I know the credentials are right without me changing anything.\nHas anyone found a reliable way of using Xcode 4 with GitHub starting with a local project first?\nIf I clone an existing GitHub repository with an Xcode project in it, open it with Xcode 4 then even though the first Push seems to fail, the 2nd push did then work. So maybe starting from absolute scratch with Xcode 4 creating the repository for me isn't the best pattern (until they improve the Git tooling in a later version of Xcode 4).\nEDIT WITH FURTHER DETAILS OF ONE WORKAROUND\nThis example only really applies to the first project you're adding to a GitHub repository. As such I think you're better off with the following steps, bearing in mind there still seem to be some Xcode 'gotchas' in this solution.\n\nList item\n'Connect to a repository' from Welcome to Xcode dialog.\nUse GitHub SSH URL for Location\nGive it a name (RepositoryName)and Clone to a directory\n1st attempt appears to fail even though contents are downloaded\nTry Again and it works.\nThere is now a new Repository defined in the Organizer window with its origin set to the GitHub remote SSH URL.\nCreate a New Project within the directory you just cloned into but DO NOT tick the 'Create local git repository for this project' option.\nDo initial commit to local Git repository.\nTry Source Control -> Push and Xcode 4 fails with 'The operation could not be performed because access to the repository RepositoryName was denied. Check username and password'\nTry Source Control -> Push and Xcode 4 pops up the remote Repository dialog again but this time has detected a remote Repository called origin. Next to it there's a yellow ball and 'Authentication required'.\nClicking 'Push' again caused the remote Push to work.\n\nOne thing I've spotted and not managed to work out yet is that the response messages back from GitHub with the checkin hash value and any messages seem to get reported in Xcode Log navigator as Push failures, even though the Push is successful as far as GitHub is concerned.\nAnyone else have a better solution?"
},
{
"role": "assistant",
"content": "I think I found the Xcode way to push a existing project to GitHub or any other remote repository! \nPreconditions\n\nI assume that you have a project created by Xcode 4 with a local git repository.\nYou created an empty remote git repository (I call it RemoteRepository in in the following example)\n\nPush it to remote\n\nOpen the Organizer in Xcode an go to the Repositories tab\nAt first click on Remotes and then on \"Add Remote\" \n\nEnter a Remote Name and the Location of your remote repository and click on create \n\nThen select your project and open File -> Source Control -> Push ... \n\nSelect your remote repository and wait until it is connectable! Look for the Create in the brackets.\n\nNow your old project is published to GitHub\n\n\nI hope it will works for you also! In my case it works with every remote git repository.\nPlease contact me on twitter if something unclear or wrote in bad English!"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --output=<file>"
},
{
"role": "assistant",
"content": "Output to a specific file instead of stdout."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Get out of a folder using Git Bash\n\nI am using Git Bash and am trying a few things like making a 'commit' and 'push' to GitHub. \nI want to get out of the current directory C:\\user\\myUsername\\app and land in the C:\\user\\myUsername folder. \nWhat commands do I write in Git Bash?"
},
{
"role": "assistant",
"content": "To change your directory in git-bash to that specific path you can use this command : \ncd /c/user/myUsername\n\nbasically you have to replace backslash with standard slash, or otherwise if you simply want to go to the parent directory you can use : \ncd ..\n\nas stated in comments that you already received on your question ..."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git pull - can't submit merge message [duplicate]\nThis question already has answers here:\n \n \n\n\n\nClosed 11 years ago.\n\n\n\n\nPossible Duplicate:\ngithub locks up mac terminal when using pull command\n\nI am using Git via the terminal on the mac.\nI have encountered an annoying problem recently when I try to perform git pull.\nAfter performing git pull I receive the following error message:\nMerge ssh://example.com/repository.git\n# Please enter a commit message to explain why this merge is necessary,\n# especially if it merges an updated upstream into a topic branch.\n#\n# Lines starting with '#' will be ignored, and an empty message aborts:\n# the commit.\n\nThe issue is that I can't enter anything. My terminal seems stuck and there isn't anything I seem to be able to do about it. I am reasonably new to Git so it may be a simple mistake I am making.\nI read here that for some people the text editor opens at this point. This certainly isn't the case at my end. It also states there that I can use the --no-edit flag to merge without a message, but even this does not seem to work at my end.\nI am a bit clueless at the moment, stuck and unable to push any changes to my server."
},
{
"role": "assistant",
"content": "This is vim, it's a common unix editor\npress:\n:wq\n\nthat's it. (w=write q=quit)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Eclipse git checkout (aka, revert)\nIs it possible to do the equivalent of git checkout from within Eclipse using the EGit plugin?\nI have a file that's been modified. I want to discards the changes and revert the file back to what's in the source repository. In Subversion this is called revert. In git the equivalent is checkout.\nI can't find any menu item under Team that looks like checkout or revert. I'm using EGit 0.6.0."
},
{
"role": "assistant",
"content": "This can be done via the context menu \"Replace with/File in Git index\" on the file in package view."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-shortlog - Summarize git log output --format[=<format>]"
},
{
"role": "assistant",
"content": "Instead of the commit subject, use some other information to\ndescribe each commit. <format> can be any string accepted\nby the --format option of git log , such as * [%h] %s .\n(See the \"PRETTY FORMATS\" section of git-log .) Each pretty-printed commit will be rewrapped before it is shown."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to send an email from GitLab CI pipeline's job?\n\nI am trying to set up a GitLab CI configuration that sends an email after a pipeline's job completes with a link of the artifacts to the upload site. The pipeline builds based upon pom.xml, then tests with sonarqube and then uploads the artifacts using curl to a specific artifactory location. The folder structure and link of the artifact directory depends upon the CI_PIPELINE_ID. After all of these succeeds, I need to send this link for downloading the artifacts to a list of people via mail. My .gitlab-config.yml looks like the following:\n\n\nimage: maven:3.3.9-jdk-8\n\nvariables:\n MAVEN_OPTS: \"-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true\"\n MAVEN_CLI_OPTS: \"-U --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true\"\n REPO_NAME: \"<artifactory url>\"\n\ncache:\n paths:\n - .m2/repository\n - ./target/\n\nstages:\n - build\n\ncompile_commit:\n stage: build\n only:\n - cr_integrate\n before_script:\n - git submodule sync --recursive\n - git submodule update --init --recursive --remote\n script:\n - mvn -f pom.xml -s settings.xml $MAVEN_CLI_OPTS clean install $MAVEN_OPTS\n - curl -i -u<username>:<token> -T \"target/<artifact-1>.zip\" \"${REPO_NAME}/${CI_PIPELINE_ID}/<artifact-1>.zip\"\n - curl -i -u<username>:<token> -T \"target/<artifact-1>.zip\" \"${REPO_NAME}/${CI_PIPELINE_ID}/<artifact-2>.zip\"\n - - curl -i -u<username>:<token> -T \"target/<artifact-1>.zip\" \"${REPO_NAME}/${CI_PIPELINE_ID}/<artifact-3>.zip\"\n tags:\n - <tagname>\n\n\n\nHow do I send a mail to some people after this with the link?"
},
{
"role": "assistant",
"content": "I built a solution for this, sharing it here.\nThe following tools were used for this:\n\nGitLab release api\nPython-GitLab api\nDocker\nMicrosoft Teams\nSharepoint\n\nThe process flow can be outlined as follows:\n\nA new pipeline is triggered\nAfter successful build, codescan and publish, a release job is run\nThe release job uses a python script written with the help of\npython-gitlab api to create a release using gitlab release api. It\ninserts external artifactory links for downloading artifacts under\nrelease assets and adds links to release note and other documents.\nGitLab sends a release mail to the appropriate notification channel,\na group email id created by Microsoft Teams and Sharepoint, so that\nthe entire team receives the release mail.\n\nThe python script is given below:\nimport os\nimport gitlab\nfrom datetime import datetime\n\nif __name__ == '__main__':\n access_token = os.environ['RELEASE_TOKEN']\n gitlab_url = os.environ['GITLAB_URL']\n project_id = int(os.environ['CI_PROJECT_ID'])\n \n tag_name = os.environ['CI_PIPELINE_ID']\n ref = os.environ['CI_COMMIT_REF_NAME']\n \n # artifactory_links\n artifactory_link = os.environ['ARTIFACTORY_PATH']\n group_name = os.environ['GROUP_NAME']\n project_name = os.environ['CI_PROJECT_NAME']\n directory = f'{datetime.now():%Y%m%d}'\n artifact_name = os.environ['ARTIFACT_NAME']\n package_type = os.environ['PACKAGE_TYPE']\n \n # artifacts_links\n artifacts_links = f'{artifactory_link}/{group_name}/{project_name}/{directory}/{artifact_name}-{tag_name}.{package_type}'\n \n # release note\n release_note = os.environ['RELEASE_NOTE']\n \n # authenticate with gitlab\n gl = gitlab.Gitlab(gitlab_url, private_token=access_token)\n gl.auth()\n \n # obtain the project object by id\n project = gl.projects.get(project_id)\n \n # creating the project tags\n project.tags.create({'tag_name': tag_name, 'ref': ref})\n \n # creating the project releases\n release = project.releases.create(\n {\n 'name': f'Release for Pipeline ID {ref}',\n 'tag_name': tag_name,\n 'description': release_note,\n 'assets': {\n 'links': [{'name': artifact_name, 'url': artifacts_links}],\n }\n }\n )\n\nThe script requires the following environment variables:\n\nRELEASE_TOKEN – GitLab access token\nGITLAB_URL – GitLab base URL.\nARTIFACTORY_PATH – Artifactory base URL.\nGROUP_NAME – In case the project is under a group.\nARTIFACT_NAME – The artifact name\nPACKAGE_TYPE – Artifact package type\nRELEASE_NOTE – Link to release note and any other document.\n\nThese variables can be provided as GitLab CI variables. If there are more than one artifacts, the python script can be modified accordingly.\nSince the python script needs to be called during the pipeline event and adding the script in the project would be modifying the project codebase, dockerizing the script is the best solution. That way, it can be pulled directly from docker hub. The dockerfile contents for this are as follows:\nFROM python:3.7-alpine\nCOPY release_api.py /bin\nRUN pip install python-gitlab\nENTRYPOINT [\"/bin/release_api.py\"]\nCMD [\"/bin/bash\"]\n\nIn order to send a release mail to every member of the team, irrespective of their individual GitLab notification and subscription preferences, a team needs to be set up using Microsoft Teams. When a team is created in Teams application, a corresponding sharepoint site is created, along with a team email id. This set up takes some time.\nOnce a team is created, under Files section, there’s an option to open it in sharepoint (screenshot below).\n\nThe sharepoint site has a link in the left sidebar called Conversations. Once the sharepoint site is fully ready, clicking this link will open the inbox of the Teams email.\nUnder the settings for the group, the option Edit Group can be found and there the group email id can be found. This group email id will be used to send the release mail to everyone in the team.\nUnder user settings of GitLab, the group email needs to be added. Once the mail is added and verified, the notification channel can be set up under Notifications. Once this is done, all notifications for that group (or project) will go to the group mail, and everyone in the team will get them. The last activity left is to set up notification preference to send a notification when a new release is available."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-switch - Switch branches -d --detach"
},
{
"role": "assistant",
"content": "Switch to a commit for inspection and discardable\nexperiments. See the \"DETACHED HEAD\" section in git-checkout for details."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to push different local Git branches to Heroku/master\n\nHeroku has a policy of ignoring all branches but 'master'.\nWhile I'm sure Heroku's designers have excellent reasons for this policy (I'm guessing for storage and performance optimization), the consequence to me as a developer is that whatever local topic branch I may be working on, I would like an easy way to switch Heroku's master to that local topic branch and do a \"git push heroku -f\" to over-write master on Heroku.\nWhat I got from reading the \"Pushing Refspecs\" section of http://progit.org/book/ch9-5.html is\ngit push -f heroku local-topic-branch:refs/heads/master\nWhat I'd really like is a way to set this up in the configuration file so that \"git push heroku\" always does the above, replacing local-topic-branch with the name of whatever my current branch happens to be. If anyone knows how to accomplish that, please let me know!\nThe caveat for this, of course, is that this is only sensible if I am the only one who can push to that Heroku app/repository. A test or QA team might manage such a repository to try out different candidate branches, but they would have to coordinate so that they all agree on what branch they are pushing to it on any given day.\nNeedless to say, it would also be a very good idea to have a separate remote repository (like GitHub) without this restriction for backing everything up to. I'd call that one \"origin\" and use \"heroku\" for Heroku so that \"git push\" always backs up everything to origin, and \"git push heroku\" pushes whatever branch I'm currently on to Heroku's master branch, overwriting it if necessary.\nWould this work?\n\n[remote \"heroku\"]\n url = [email protected]:my-app.git\n push = +refs/heads/*:refs/heads/master\n\nI'd like to hear from someone more experienced before I begin to experiment, although I suppose I could create a dummy app on Heroku and experiment with that.\nAs for fetching, I don't really care if the Heroku repository is write-only. I still have a separate repository, like GitHub, for backup and cloning of all my work.\nFootnote: This question is similar to, but not quite the same as Good Git deployment using branches strategy with Heroku?"
},
{
"role": "assistant",
"content": "See https://devcenter.heroku.com/articles/git#deploying-code\n$ git push heroku yourbranch:main"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc git diff"
},
{
"role": "assistant",
"content": "compares the (i)ndex and the (w)ork tree;"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "MySQL2 gem won't install\n\nI have been trying to install Gitlab on my Ubuntu 12.04 server for a long time, and all goes well until I run bundle install.\nIt says it is unable to install MySQL2 but gives no reason or corrective action.\nhome/gitlab/gitlab$ sudo -u gitlab -H bundle install --deployment --without development test postgres\nFetching gem metadata from http://rubygems.org/.......\nFetching gem metadata from http://rubygems.org/..\nUsing rake (10.0.1) \nUsing i18n (0.6.1) \nUsing multi_json (1.3.7) \nUsing activesupport (3.2.9) \nUsing builder (3.0.4) \nUsing activemodel (3.2.9) \nUsing erubis (2.7.0) \nUsing journey (1.0.4) \nUsing rack (1.4.1) \nUsing rack-cache (1.2) \nUsing rack-test (0.6.2) \nUsing hike (1.2.1) \nUsing tilt (1.3.3) \nUsing sprockets (2.2.1) \nUsing actionpack (3.2.9) \nUsing mime-types (1.19) \nUsing polyglot (0.3.3) \nUsing treetop (1.4.12) \nUsing mail (2.4.4) \nUsing actionmailer (3.2.9) \nUsing arel (3.0.2) \nUsing tzinfo (0.3.35) \nUsing activerecord (3.2.9) \nUsing activeresource (3.2.9) \nUsing bundler (1.2.3) \nUsing rack-ssl (1.3.2) \nUsing json (1.7.5) \nUsing rdoc (3.12) \nUsing thor (0.16.0) \nUsing railties (3.2.9) \nUsing rails (3.2.9) \nUsing acts-as-taggable-on (2.3.3) \nUsing backports (2.6.5) \nUsing bcrypt-ruby (3.0.1) \nUsing blankslate (3.1.2) \nUsing sass (3.2.3) \nUsing bootstrap-sass (2.2.1.1) \nUsing carrierwave (0.7.1) \nUsing charlock_holmes (0.6.9) \nUsing chosen-rails (0.9.8) \nUsing coffee-script-source (1.4.0) \nUsing execjs (1.4.0) \nUsing coffee-script (2.2.0) \nUsing coffee-rails (3.2.2) \nUsing colored (1.2) \nUsing daemons (1.1.9) \nUsing orm_adapter (0.4.0) \nUsing warden (1.2.1) \nUsing devise (2.1.2) \nUsing diff-lcs (1.1.3) \nUsing draper (0.18.0) \nUsing escape_utils (0.2.4) \nUsing eventmachine (1.0.0) \nUsing multipart-post (1.1.5) \nUsing faraday (0.8.4) \nUsing ffaker (1.15.0) \nUsing sass-rails (3.2.5) \nUsing font-awesome-sass-rails (2.0.0.0) \nUsing foreman (0.60.2) \nUsing gemoji (1.2.1) \nUsing git (1.2.5) \nUsing posix-spawn (0.3.6) \nUsing yajl-ruby (1.1.0) \nUsing pygments.rb (0.3.2) from https://github.com/gitlabhq/pygments.rb.git (at master) \nUsing github-linguist (2.3.4) \nUsing github-markup (0.7.4) \nUsing gitlab_meta (4.0) \nUsing gratr19 (0.4.4.1) \nUsing grit (2.5.0) from https://github.com/gitlabhq/grit.git (at 7f35cb9) \nUsing hashery (1.5.0) \nUsing gitolite (1.1.0) \nUsing grack (1.0.0) from https://github.com/gitlabhq/grack.git (at ba46f3b) \nUsing hashie (1.2.0) \nUsing multi_xml (0.5.1) \nUsing rack-accept (0.4.5) \nUsing rack-mount (0.8.3) \nUsing virtus (0.5.2) \nUsing grape (0.2.2) \nUsing grit_ext (0.6.1) from https://github.com/gitlabhq/grit_ext.git (at 8e6afc2) \nUsing haml (3.1.7) \nUsing haml-rails (0.3.5) \nUsing httparty (0.9.0) \nUsing httpauth (0.2.0) \nUsing jquery-atwho-rails (0.1.7) \nUsing jquery-rails (2.1.3) \nUsing jquery-ui-rails (2.0.2) \nUsing jwt (0.1.5) \nUsing kaminari (0.14.1) \nUsing kgio (2.7.4) \nUsing libv8 (3.3.10.4) \nUsing modernizr (2.6.2) \nInstalling mysql2 (0.3.11) with native extensions \nGem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.\n\n /usr/local/bin/ruby extconf.rb \nchecking for rb_thread_blocking_region()... yes\nchecking for rb_wait_for_single_fd()... yes\nchecking for mysql_query() in -lmysqlclient... no\nchecking for main() in -lm... yes\nchecking for mysql_query() in -lmysqlclient... no\nchecking for main() in -lz... yes\nchecking for mysql_query() in -lmysqlclient... no\nchecking for main() in -lsocket... no\nchecking for mysql_query() in -lmysqlclient... no\nchecking for main() in -lnsl... yes\nchecking for mysql_query() in -lmysqlclient... no\nchecking for main() in -lmygcc... no\nchecking for mysql_query() in -lmysqlclient... no\n*** extconf.rb failed ***\nCould not create Makefile due to some reason, probably lack of\nnecessary libraries and/or headers. Check the mkmf.log file for more\ndetails. You may need configuration options.\n\nProvided configuration options:\n --with-opt-dir\n --without-opt-dir\n --with-opt-include\n --without-opt-include=${opt-dir}/include\n --with-opt-lib\n --without-opt-lib=${opt-dir}/lib\n --with-make-prog\n --without-make-prog\n --srcdir=.\n --curdir\n --ruby=/usr/local/bin/ruby\n --with-mysql-config\n --without-mysql-config\n --with-mysql-dir\n --without-mysql-dir\n --with-mysql-include\n --without-mysql-include=${mysql-dir}/include\n --with-mysql-lib\n --without-mysql-lib=${mysql-dir}/lib\n --with-mysqlclientlib\n --without-mysqlclientlib\n --with-mlib\n --without-mlib\n --with-mysqlclientlib\n --without-mysqlclientlib\n --with-zlib\n --without-zlib\n --with-mysqlclientlib\n --without-mysqlclientlib\n --with-socketlib\n --without-socketlib\n --with-mysqlclientlib\n --without-mysqlclientlib\n --with-nsllib\n --without-nsllib\n --with-mysqlclientlib\n --without-mysqlclientlib\n --with-mygcclib\n --without-mygcclib\n --with-mysqlclientlib\n --without-mysqlclientlib\n\n\nGem files will remain installed in /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11 for inspection.\nResults logged to /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/ext/mysql2/gem_make.out\nAn error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.\nMake sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.\nroot@Server:/home/gitlab/gitlab$"
},
{
"role": "assistant",
"content": "It does tell you a generic possible problem:\n\nCould not create Makefile due to some reason, probably lack of\n necessary libraries and/or headers. Check the mkmf.log file for more\n details. You may need configuration options.\n\nThat's your clue.\nMake sure you've installed the MySQL client repo, along with the associated \"devel\" package. Languages like Ruby, Python, Perl, etc., need the libraries and headers installed so they can compile native modules providing the interface from the language to the drivers.\nAlso, you'll need mysql_config, which is installed by:\nsudo apt-get install libmysqlclient-dev\n\nI was able to duplicate your problem with my Ubuntu VM, and fix it after installing libmysqlclient-dev.\nIt places mysql_config in /usr/bin/mysql_config, and both gem install mysql and gem install mysql2 were able to install successfully."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs %as"
},
{
"role": "assistant",
"content": "author date, short format ( YYYY-MM-DD )"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to add directory recursively on git safe.directory?\nAccording to this QA, we may use safe.directory argument to add directory to be marked as whitelist, due to latest CVE found on git. But it seems there is no way to add certain dirs recursively.\nI have so many repositories to add, so i want to use recursive add instead, if the feature is exist. The repositories mostly placed on my mounted NTFS disk on ubuntu, so the owner of files inside is always root. Looks like the latest update restricts git operations if the logged in user is not match with owner of the git directory by showing error such fatal: unsafe repository ('/media/data1/project1/si/project' is owned by someone else."
},
{
"role": "assistant",
"content": "From Git 2.36, you can also add * representing 'all' to the safe.directory. It's not recursive as you asked, but it may help depending upon your situation i.e.\ngit config --global --add safe.directory \"*\"\n\nSee https://github.blog/2022-04-18-highlights-from-git-2-36/ and search for safe.directory.\nEDIT: As suggested by zcoop98, we should add double quotes around '*'."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I get notifications on new GitHub issues?\n\nRight now, I miss quite some issues for my project hosted on GitHub. I am looking for a way which tells me of new issues. E-Mail would be fine, but those are only sent if I participated in a specific issue. IRC is also an option.\nFor both email and IRC, google spit out nothing helpful. Is this really not possible?"
},
{
"role": "assistant",
"content": "Actually, this one was a bit tricky. I didn't realize that notifications work slightly different with organizations. Sorry, I really forgot about this question and I can't tell you exactly how to configure it as this was a while ago - but if you stumble over this, and you are trying to get notifications for issues that are in organization projects, you should read this:\nhttp://alexking.org/blog/2011/11/28/not-getting-github-notifications\nwhose key point is (a quote from Github support):\n\nUsers in the Owners group don’t receive notifications. You need to create a normal team and add yourself to it to get notifications for that team’s repos."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rebase - Reapply commits on top of another base tip --reschedule-failed-exec --no-reschedule-failed-exec"
},
{
"role": "assistant",
"content": "Automatically reschedule exec commands that failed. This only makes\nsense in interactive mode (or when an --exec option was provided). This option applies once a rebase is started. It is preserved for the whole\nrebase based on, in order, the command line option provided to the initial git\nrebase , the rebase.rescheduleFailedExec configuration (see git-config or \"CONFIGURATION\" below), or it defaults to false. Recording this option for the whole rebase is a convenience feature. Otherwise\nan explicit --no-reschedule-failed-exec at the start would be overridden by\nthe presence of a rebase.rescheduleFailedExec=true configuration when git\nrebase --continue is invoked. Currently, you cannot pass --[no-]reschedule-failed-exec to git rebase --continue ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-gc - Cleanup unnecessary files and optimize the local repository"
},
{
"role": "assistant",
"content": "DESCRIPTION Runs a number of housekeeping tasks within the current repository,\nsuch as compressing file revisions (to reduce disk space and increase\nperformance), removing unreachable objects which may have been\ncreated from prior invocations of git add , packing refs, pruning\nreflog, rerere metadata or stale working trees. May also update ancillary\nindexes such as the commit-graph. When common porcelain operations that create objects are run, they\nwill check whether the repository has grown substantially since the\nlast maintenance, and if so run git gc automatically. See gc.auto below for how to disable this behavior. Running git gc manually should only be needed when adding objects to\na repository without regularly running such porcelain commands, to do\na one-off repository optimization, or e.g. to clean up a suboptimal\nmass-import. See the \"PACKFILE OPTIMIZATION\" section in git-fast-import for more details on the import case."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "integrate puppeteer in gitlab with gitlab-ci.yml\n\nIm currently working on e2e test in Chrome Puppeteer. I am at the stage where it would be ideal to integrate my tests in the development process. \nWhat I want to accomplish is the following: my tests run automated before every deploy to production. If they succeed deployment goes through, if they fail deployment is canceled. \nI use a pipeline on gitlab to automate my deployment process. \nSo my main question is how can I integrate my puppeteer tests into the gitlab-ci.yml file?"
},
{
"role": "assistant",
"content": "This might be a bit of a hack but mine are running like this:\ntest:\nimage: node:latest\nstage: run\nscript:\n- apt-get update\n- apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget\n- yarn\n- yarn test\n\nThat super long list of libraries are the ones that the puppeteer needs to launch chrome. Ideally you would have a ready docker image but all the premade ones I found did not work for me. \nWhen getting ready for prod you should build your own image that takes from node and installs the dependencies itself."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitHub Pages for Private Repository [closed]\n\nClosed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.\n \n \n\n\n\n\n\n\n\n\n\n\n\n We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.\n\n\nClosed 4 years ago.\n\n\n\n\n\n\n\n Improve this question\n \n\n\n\nAnyone know if there's a way to create GitHub Pages for a Private Repo?\nI was just thinking about the possibility to use GitHub Pages to host a small website, but keep the source repository private. This way the only way the content would be exposed would be through the public GitHub Pages URL.\nFYI, I would just try it and see, but I don't want to convert to a paid GitHub account at this point until I know if this is possible."
},
{
"role": "assistant",
"content": "As of August 2020\nIt is only possible with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server.\n\nSee: What is GitHub pages"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab runner + autoscaling + scaled runner options\n\nI'm using gitlab runner with docker+machine executor to fire up autoscaled runners on AWS. I would like to use docker-in-docker setup inside the runners to build containers, but I can't find out how to define the needed [runners.docker] properties for the spawned runners to enable docker usage.\nIs it possible to somehow pass some config info to autoscaled runners?"
},
{
"role": "assistant",
"content": "you just need this in your config.toml of your autoscale runner: \n[runners.docker]\n privileged = true\n\nI use docker-in-docker to build my own php containers for testing and store them in gitlabs registry. see https://gitlab.cwd.at/docker/php/builds/21582 for a build example and https://gitlab.cwd.at/docker/php/blob/master/.gitlab-ci.yml for the build definition\nsee here my current config - its using S3 for caching and digitalocean for the runners:\nconcurrent = 10\n\n[[runners]]\n name = \"ec2-autoscale-runner\"\n url = \"https://gitlab.mydomain.at/ci\"\n token = \"12345\"\n executor = \"docker+machine\"\n limit = 10\n environment = [\"COMPOSER_CACHE_DIR=/cache\"]\n [runners.machine]\n OffPeakPeriods = [ # Set the Off Peak time mode on for:\n \"* * 0-9,18-23 * * mon-fri *\", # - Monday to Friday for 12am to 9am and 6pm to 11pm\n \"* * * * * sat,sun *\" # - whole Saturday and Sunday\n ]\n OffPeakIdleCount = 0 # There must be 1 machine in Idle state - when Off Peak time mode is on\n OffPeakIdleTime = 3550 # Each machine can be in Idle state up to 1200 seconds (after this it will be removed) - when Off Peak time mode is on\n IdleCount = 0 # There must be 5 machines in Idle state - when Off Peak time mode is off\n IdleTime = 3550 # Each machine can be in Idle state up to 600 seconds (after this it will be removed) - when Off Peak time mode is off\n MaxBuilds = 100 # Each machine can handle up to 100 builds in a row (after this it will be removed)\n MachineName = \"auto-scale-%s\" # Each machine will have a unique name ('%s' is required)\n MachineDriver = \"digitalocean\" # Docker Machine is using the 'digitalocean' driver\n MachineOptions = [\n \"digitalocean-image=21937863\",\n #\"digitalocean-image=20969606\",\n \"digitalocean-access-token=12345\",\n \"digitalocean-region=fra1\",\n \"digitalocean-size=4gb\",\n \"digitalocean-private-networking\",\n \"digitalocean-ipv6=true\"\n ]\n [runners.ssh]\n user = \"root\"\n identity_file = \"/etc/gitlab-runner/id_rsa\"\n [runners.docker]\n privileged = true\n [runners.cache]\n Type = \"s3\"\n ServerAddress = \"s3.amazonaws.com\"\n AccessKey = \"1234\"\n SecretKey = \"1234\"\n BucketName = \"cwd-gitlab-cache\"\n BucketLocation = \"eu-central-1\"\n Insecure = false"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Configuring Git over SSH to login once\nI have cloned my git repository over ssh. So, each time I communicate with the origin master by pushing or pulling, I have to reenter my password. How can I configure git so that I do not need to enter my password multiple times?"
},
{
"role": "assistant",
"content": "Had a similar problem with the GitHub because I was using HTTPS protocol. To check what protocol you're using just run\ngit config -l\n\nand look at the line starting with remote.origin.url. To switch your protocol\ngit config remote.origin.url [email protected]:your_username/your_project.git"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-svn - Bidirectional operation between a Subversion repository and Git svn.useSvmProps svn-remote.<name>.useSvmProps"
},
{
"role": "assistant",
"content": "This allows git svn to re-map repository URLs and UUIDs from\nmirrors created using SVN::Mirror (or svk) for metadata. If an SVN revision has a property, \"svm:headrev\", it is likely\nthat the revision was created by SVN::Mirror (also used by SVK).\nThe property contains a repository UUID and a revision. We want\nto make it look like we are mirroring the original URL, so\nintroduce a helper function that returns the original identity\nURL and UUID, and use it when generating metadata in commit\nmessages."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "XAMPP: Another web server is already running\n\nI get the following error after installing gitlab..\nroot@Blase:~# sudo /opt/lampp/lampp start\nStarting XAMPP for Linux 7.0.9-1...\nXAMPP: Starting Apache...fail.\n[XAMPP: Another web server is already running.][1]\nXAMPP: Starting MySQL...already running.\n\nI cannot access my localhost/phpmyadmin or any projects folder as am redirected to Gitlab.\nI tried to view which program is using port 80 by running:\n\"netstat -tulpn | grep --color :80\" and i got the output shown in attached image.\nAny help guys?"
},
{
"role": "assistant",
"content": "I had to stop all the services, \n$sudo /etc/init.d/apache2 stop\n\n$sudo /etc/init.d/mysql stop\n\n$sudo /etc/init.d/proftpd stop\n\nThen I restarted the server\nsudo /opt/lampp/lampp restart"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options core.protectNTFS"
},
{
"role": "assistant",
"content": "If set to true, do not allow checkout of paths that would\ncause problems with the NTFS filesystem, e.g. conflict with\n8.3 \"short\" names.\nDefaults to true on Windows, and false elsewhere."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs --cherry"
},
{
"role": "assistant",
"content": "A synonym for --right-only --cherry-mark --no-merges ; useful to\nlimit the output to the commits on our side and mark those that\nhave been applied to the other side of a forked history with git log --cherry upstream...mybranch , similar to git cherry upstream mybranch ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to store releases/binaries in GitLab?\n\nI am building a workflow with Gitlab, Jenkins and - probably - Nexus (I need an artifact storage). I would like to have GitLab to store releases/binaries - is it possible in a convenient way?\nI would not like to have another service from which a release (and documentation) could be downloaded but to have it somehow integrated with repository manager, just like releases are handled in e.g. GitHub. Any clues?"
},
{
"role": "assistant",
"content": "Update Oct. 2020:\nGitLab 13.5 now offers:\n\nAttach binary assets to Releases\nIf you aren’t currently using GitLab for your releases because you can’t attach binaries to releases, your workflow just got a lot simpler.\nYou now have the ability to attach binaries to a release tag from the gitlab.ci-yml. This extends support of Release Assets to include binaries, rather than just asset links or source code. This makes it even easier for your development teams to adopt GitLab and use it to automate your release process.\n\nSee Documentation and Issue.\n\n\nUpdate Nov. 2015: GitLab 8.2 now supports releases.\nWith its API, you now can create and update a relase associated to a tag.\nFor now, it is only the ability to add release notes (markdown text and attachments) to git tags (aka Releases).\n\nfirst upload the release binary\ncreate a new release and place a link to the uploaded binary in the description\n\nUpdate May 2019: GitLab 1.11 introduces an interesting \"Guest access to Releases\":\n\nIt is now possible for guest users of your projects to view releases that you have published on the Releases page.\nThey will be able to download your published artifacts, but are not allowed to download the source code nor see repository information such as tags and commits.\n\n\nOriginal answer March 2015\nThis is in progress, and suggested in suggestions 4156755:\n\nWe’re accepting merge requests for the minimal proposal by Ciro:\n\n\n\nFor each repository tag under https://github.com/cirosantilli/test/releases/tag/3.0, allow to upload and download a list of files.\n2. The upload and download can be done directly from the tag list view.\n3. If a tag gets removed, the uploads are destroyed.\n(we’re not accepting the tag message edit mentioned in recent comments)\n\n\n\nThe comments to that suggestion include:\n\nWhat makes it more interesting is the next step.\nI would really like a way to let public download artifacts from \"releases\" without being able to access source code (i.e. make sources private for project team only except anything else like wiki, \"releases\", issue tracker).\n\n\nHowever, such additional feature looks more generic and I submitted a separate feature request for that.\n\n\nNevertheless, I repeat my point here:\nWhile the simplistic version of \"releases\" is still nice to have, many people can easily set up external file server and point URLs in release/tag description to this server outside GitLab.\nIn other words, \"releases\" may not look attractive now without some future picture of integration."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Using Git with Visual Studio [closed]\nClosed. This question is opinion-based. It is not currently accepting answers.\n \n \n\n\n\n\n\n\n\n\n\n\n\nWant to improve this question? Update the question so it can be answered with facts and citations by editing this post.\n\n\nClosed 10 years ago.\n\n\n\n\n\n\n\n Improve this question\n \n\n\n\nAs a long-time Visual SourceSafe user (and hater) I was discussing switching to SVN with a colleague; he suggested using Git instead. Since, apparently, it can be used as peer-to-peer without a central server (we are a 3-developer team). \nI have not been able to find anything about tools that integrate Git with Visual Studio, though - does such a thing exist? \nWhat are the technologies available for using Git with Visual Studio? And what do I need to know about how they differ before I begin?"
},
{
"role": "assistant",
"content": "In Jan 2013, Microsoft announced that they are adding full Git support into all their ALM products. They have published a plugin for Visual Studio 2012 that adds Git source control integration.\nAlternatively, there is a project called Git Extensions that includes add-ins for Visual Studio 2005, 2008, 2010 and 2012, as well as Windows Explorer integration. It's regularly updated and having used it on a couple of projects, I've found it very useful.\nAnother option is Git Source Control Provider."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-help - Display help information about Git"
},
{
"role": "assistant",
"content": "DESCRIPTION With no options and no <command> or <doc> given, the synopsis of the git command and a list of the most commonly used Git commands are printed\non the standard output. If the option --all or -a is given, all available commands are\nprinted on the standard output. If the option --guides or -g is given, a list of the\nGit concept guides is also printed on the standard output. If a command or other documentation is given, the relevant manual page\nwill be brought up. The man program is used by default for this\npurpose, but this can be overridden by other options or configuration\nvariables. If an alias is given, git shows the definition of the alias on\nstandard output. To get the manual page for the aliased command, use git <command> --help . Note that git --help ... is identical to git help ... because the\nformer is internally converted into the latter. To display the git man page, use git help git . This page can be displayed with git help help or git help --help ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs --name-only"
},
{
"role": "assistant",
"content": "Show only names of changed files. The file names are often encoded in UTF-8.\nFor more information see the discussion about encoding in the git-log manual page."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git submodule push\nIf I modify a submodule, can I push the commit back to the submodule origin, or would that require a clone?\nIf clone, can I store a clone inside another repository?"
},
{
"role": "assistant",
"content": "A submodule is nothing but a clone of a git repo within another repo with some extra meta data (gitlink tree entry, .gitmodules file )\n$ cd your_submodule\n$ git checkout master\n<hack,edit>\n$ git commit -a -m \"commit in submodule\"\n$ git push\n$ cd ..\n$ git add your_submodule\n$ git commit -m \"Updated submodule\""
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-list - Lists commit objects in reverse chronological order %cI"
},
{
"role": "assistant",
"content": "committer date, strict ISO 8601 format"
}
] |
[
{
"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": "SYNOPSIS git checkout-index [-u] [-q] [-a] [-f] [-n] [--prefix=<string>]\n\t\t [--stage=<number>|all]\n\t\t [--temp]\n\t\t [--ignore-skip-worktree-bits]\n\t\t [-z] [--stdin]\n\t\t [--] [<file>…]"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-cat-file - Provide contents or details of repository objects flush"
},
{
"role": "assistant",
"content": "Used with --buffer to execute all preceding commands that were issued\nsince the beginning or since the last flush was issued. When --buffer is used, no output will come until a flush is issued. When --buffer is not used, commands are flushed each time without issuing flush ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fsck - Verifies the connectivity and validity of the objects in the database missingTree"
},
{
"role": "assistant",
"content": "(ERROR) Missing tree line in a commit object."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab CI - Specifying stages in before_script\n\ni want to run a script that is needed for my test_integration and build stage. Is there a way to specify this in the before script so i don't have to write it out twice.\nbefore_script:\n stage: ['test_integration', 'build']\n\nthis does not seem to work i get the following error in gitlab ci linter.\n\nStatus: syntax is incorrect \nError: before_script config should be an array of strings\n\n.gitlab-ci.yml\nstages:\n - security\n - quality\n - test\n - build\n - deploy\n\nimage: node:10.15.0\n\nbefore_script:\n stage: ['test_integration', 'build']\n script:\n - apt-get update\n - apt-get -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common\n - curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -\n - add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable\"\n - apt-get update\n - apt-get -y install docker-ce\n - curl -L \"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\n - chmod +x /usr/local/bin/docker-compose\n - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY\n\n\nservices:\n - mongo\n - docker:dind\n\nsecurity:\n stage: security\n script:\n - npm audit\n\nquality:\n stage: quality\n script:\n - npm install\n - npm run-script lint\n\ntest_unit:\n stage: test\n script:\n - npm install\n - npm run-script unit-test\n\ntest_integration:\n stage: test\n script:\n - docker-compose -f CI/backend-service/docker-compose.yml up -d\n - npm install\n - npm run-script integration-test\n\nbuild:\n stage: build\n script:\n - npm install\n - export VERSION=`git describe --tags --always`\n - docker build -t $CI_REGISTRY_IMAGE:$VERSION .\n - docker push $CI_REGISTRY_IMAGE\n\ndeploy:\n stage: deploy\n script: echo 'deploy'"
},
{
"role": "assistant",
"content": "The before_script syntax does not support a stages section. You could use before_script as you have done without the stages section, however the before_script stage would run for every single job in the pipeline.\nInstead, what you could do is use YAML's anchor's feature (supported by Gitlab), which allows you to duplicate content across the .gitlab-ci file.\nSo in your scenario, it would look something like:\nstages:\n - security\n - quality\n - test\n - build\n - deploy\n\nimage: node:10.15.0\n\n.before_script_template: &build_test-integration\n before_script:\n - apt-get update\n - apt-get -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common\n - curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -\n - add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable\"\n - apt-get update\n - apt-get -y install docker-ce\n - curl -L \"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\n - chmod +x /usr/local/bin/docker-compose\n - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY\n\n\nservices:\n - mongo\n - docker:dind\n\nsecurity:\n stage: security\n script:\n - npm audit\n\nquality:\n stage: quality\n script:\n - npm install\n - npm run-script lint\n\ntest_unit:\n stage: test\n script:\n - npm install\n - npm run-script unit-test\n\ntest_integration:\n stage: test\n <<: *build_test-integration\n script:\n - docker-compose -f CI/backend-service/docker-compose.yml up -d\n - npm install\n - npm run-script integration-test\n\nbuild:\n stage: build\n <<: *build_test-integration\n script:\n - npm install\n - export VERSION=`git describe --tags --always`\n - docker build -t $CI_REGISTRY_IMAGE:$VERSION .\n - docker push $CI_REGISTRY_IMAGE\n\ndeploy:\n stage: deploy\n script: echo 'deploy'\n\n\nEdit: there is another way, instead of using anchors, you could also use extends syntax:\n.before_script_template:\n before_script:\n - apt-get update\n - apt-get -y install apt-transport-https ca-certificates curl gnupg2 software-properties-common\n - curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -\n - add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable\"\n - apt-get update\n - apt-get -y install docker-ce\n - curl -L \"https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\n - chmod +x /usr/local/bin/docker-compose\n - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY\n\ntest_integration:\n extends: .before_script_template\n stage: test \n script:\n - docker-compose -f CI/backend-service/docker-compose.yml up -d\n - npm install\n - npm run-script integration-test\n \nbuild:\n extends: .before_script_template\n stage: build\n script:\n - npm install\n - export VERSION=`git describe --tags --always`\n - docker build -t $CI_REGISTRY_IMAGE:$VERSION .\n - docker push $CI_REGISTRY_IMAGE\n\netc"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fsck - Verifies the connectivity and validity of the objects in the database GIT_ALTERNATE_OBJECT_DIRECTORIES"
},
{
"role": "assistant",
"content": "used to specify additional object database roots (usually unset)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-submodule - Initialize, update or inspect submodules --cached"
},
{
"role": "assistant",
"content": "This option is only valid for status and summary commands. These\ncommands typically use the commit found in the submodule HEAD, but\nwith this option, the commit stored in the index is used instead."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs log.decorate"
},
{
"role": "assistant",
"content": "Print out the ref names of any commits that are shown by the log\ncommand. If short is specified, the ref name prefixes refs/heads/ , refs/tags/ and refs/remotes/ will not be printed. If full is\nspecified, the full ref name (including prefix) will be printed.\nIf auto is specified, then if the output is going to a terminal,\nthe ref names are shown as if short were given, otherwise no ref\nnames are shown. This is the same as the --decorate option\nof the git log ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab Coverage badge not working\n\nI am deploying Django application using Gitlab CI/CD and pytest for testing of code and pytest-cov for generating coverage report\nMy .gitlab-ci.yml\nstages:\n - test\n - deploy\n\nimage: python:3.6\n\ntest:\n stage: test\n script:\n - pip install pipenv\n - pipenv install\n - pipenv run py.test src/\n artifacts:\n paths:\n - htmlcov/\n\npages:\n stage: deploy\n dependencies:\n - test\n script:\n - mv htmlcov/ public/\n artifacts:\n paths:\n - public\n expire_in: 30 days\n only:\n - master\n\nstaging:\n stage: deploy\n script:\n - apt-get update -qy\n - apt-get install -y ruby-dev\n - gem install dpl\n - dpl --provider=heroku --app=app-staging --api-key=$HEROKU_PRODUCTION_API_KEY\n only:\n - master\n\nproduction:\n stage: deploy\n script:\n - apt-get update -qy\n - apt-get install -y ruby-dev\n - gem install dpl\n - dpl --provider=heroku --app=app-production --api-key=$HEROKU_PRODUCTION_API_KEY\n when: manual\n only:\n - master\n\nSince repository is under a group namespace, the url to the coverage report is\nhttps://<group>.gitlab.io/<repository>/\n\nFor coverage report,\n[](https://<group>.gitlab.io/<repository>/)\n\nBut this is displaying Unknown\n\nI have setup Test Coverage parsing regex for python"
},
{
"role": "assistant",
"content": "I know this is an old question, but this may help others see this question in the future.\nExcept setting the Test Coverage parsing regex in the Settings, CI/CD page, you need to make sure the test coverage percent is printed somewhere in the CI's console log. The printed line should match the given regex. So, Gitlab can parse and save it as the code coverage percent.\nI've answered with more detail the same question: Gitlab coverage badge always unknow"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-gc - Cleanup unnecessary files and optimize the local repository --[no-]cruft"
},
{
"role": "assistant",
"content": "When expiring unreachable objects, pack them separately into a\ncruft pack instead of storing them as loose objects. --cruft is on by default."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I keep my branch up to date with master with git?\nI have a bug fix in my master, and I also want my branch to get that bug fix. What git command do I use?"
},
{
"role": "assistant",
"content": "Assuming you're fine with taking all of the changes in master, what you want is:\ngit checkout <my branch>\n\nto switch the working tree to your branch; then:\ngit merge master\n\nto merge all the changes in master with yours."
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.