messages
listlengths 3
3
|
---|
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Can I share my private GitHub repository by link?\n\nI have a Java application in a private repository on GitHub and I would like to share it with someone who doesn't have an account. I didn't find any option on the site for this.\nIs there a way to do this? Collaborators can be only GitHub users."
},
{
"role": "assistant",
"content": "There is no way to share private repository among non-Github users.\nYou need the Github account and be added as collaborator to the project."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to use private Github repo as npm dependency\n\nHow do I list a private Github repo as a \"dependency\" in package.json? I tried npm's Github URLs syntaxes like ryanve/example, but doing npm install in the package folder gives \"could not install\" errors for the private dependencies. Is there a special syntax (or some other mechanism) for depending on private repos?"
},
{
"role": "assistant",
"content": "It can be done via https and oauth or ssh.\nhttps and oauth: create an access token that has \"repo\" scope and then use this syntax:\n\"package-name\": \"git+https://<github_token>:[email protected]/<user>/<repo>.git\"\n\nor\nssh: setup ssh and then use this syntax:\n\"package-name\": \"git+ssh://[email protected]:<user>/<repo>.git\"\n\n(note the use of colon instead of slash before user)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-shortlog"
},
{
"role": "assistant",
"content": "Summarize git log output"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "opposite of .gitignore file? [duplicate]\nThis question already has answers here:\n \n \n\n\n\nClosed 11 years ago.\n\n\n\n\nPossible Duplicate:\nMake .gitignore ignore everything except a few files \n\nIs it possible to let git ignore all files by default, unless specified in a special file?"
},
{
"role": "assistant",
"content": "You can include !-lines to whitelist files: a .gitignore with:\n*\n!included/\n\nwill exclude all, but the 'included/' directory\nNote that if you want files matching a pattern to be un-ignored, in subdirectories, you will need to prevent the containing directories from getting ignored too. This should not pose a large problem, since git doesn't actually track directories, only files (identified by a repository path).\nExample:\n*\n!*/\n!SOURCES\n\nwill ignore everything, except SOURCES in subdirectories."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is the Git equivalent for revision number?\nWe use SVN at work, but for my personal projects I decided to use Git. So I installed Git yesterday, and I wonder what is the revision number equivalent in Git.\nLet's say we work on version 3.0.8 and every bug fix has its own revision number we can use when we talk about this bug fix. So if I tag the code in Git to 3.0.8 what then I can use as a revision number or some other more detailed kind of identification? I find the hash not so user friendly for humans."
},
{
"role": "assistant",
"content": "With modern Git (1.8.3.4 in my case) and not using branches you can do:\n$ git rev-list --count HEAD\n68\n\nBut this has all kinds of issues and might not be easy to reproduce or easy to get back to the commit hash in case you need to. So try to avoid it or use it only as a hint."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs git log -3"
},
{
"role": "assistant",
"content": "Limits the number of commits to show to 3."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I make 'git-diff' and 'git log' ignore new and deleted files?\nSometimes there are a couple of changed files together with some new, deleted and/or renamed files. When doing git diff or git-log, I'd like to omit them, so I can better spot the modifications.\nActually, listing the names of the new and deleted files without their content would be best. For \"old\" renamed to \"new\" I'd like to optionally get the difference between \"old\" and \"new\"."
},
{
"role": "assistant",
"content": "The --diff-filter option works with both diff and log.\nI use --diff-filter=M a lot which restricts diff outputs to only content modifications.\nTo detect renames and copies and use these in the diff output, you can use -M and -C respectively, together with the R and C options to --diff-filter."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rebase - Reapply commits on top of another base tip --whitespace=<option>"
},
{
"role": "assistant",
"content": "This flag is passed to the git apply program\n(see git-apply ) that applies the patch.\nImplies --apply . See also INCOMPATIBLE OPTIONS below."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to set patience as default git diff algorithm\nIn .git/config I tried:\n[diff]\n patience = true\n\nBut no luck\nDo I have to do:\ngit diff --patience\ngit show --patience HEAD\n\netc., every time?"
},
{
"role": "assistant",
"content": "Since Git 1.8.2, Git will use diff.algorithm:\ngit config --global diff.algorithm patience\n\nIt took a few iterations:\n\n[PATCH v3 0/3] Rework git-diff algorithm selection\n[PATCH v2 0/3] Rework git-diff algorithm selection\n[PATCH 0/3] Rework git-diff algorithm selection\n[PATCH] diff: Introduce diff.algorithm variable.\n[PATCH] config: Introduce --patience config variable"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-http-backend"
},
{
"role": "assistant",
"content": "Server side implementation of Git over HTTP"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Move tag one commit ahead\n\nI have a repository with only one branch (master). I'm the only contributor to my repo.\nI've recently added a tag, both locally and pushed to GitHub. After making what I though was the last necessary commit, but now I realize I should have made one more change/commit.\nSo what I have is:\ncommit 124\ncommit 125\ncommit 126 <-- tag v1.0\ncommit 127\n\nand I want to move the v1.0 tag to the next commit, ie: 127, both locally and in GitHub.\nHow can I do that?"
},
{
"role": "assistant",
"content": "Have you ever been to a book club where members do not all use the same edition of the \"book of the week\"? It's a nightmare, right? Moving a tag would essentially put you in the same situation.\nIf you think of your repository as a book that chronicles progress in your project, you can think of a tag as a chapter heading.\n\nMoving a tag to a different commit after sharing it is like telling all your book-club buddies\n\nYou know what, guys? The edition of the book we've all been using so far is now obsolete, because I have solely decreed that chapter 8 shall now start, not on page 126, but on page 128.\n\nNot good. Moving a tag is a form of history rewriting, and you shouldn't rewrite history that has been shared. It's the surest way to piss your collaborators off. Besides, you write\n\nI'm the only contributor to my repo [...]\n\nThat may be true for now, but if other people than you have access to your GitHub repository (e.g. if it's public), some of them may already have forked or cloned it (although there is a way to find out), and you run the risk of pissing them off if you rewrite history.\n\nIf you're 100% sure that you want to move that tag anyway, Git does allow you to do it. Here, you could use\ngit tag --force v1.0 <ID-of-commit-127>\n\nand then you would have to force push that tag, using\ngit push --force --tags\n\nBut again, think twice before going ahead...\nAddendum (2018/09/26)\nI feel the need to revisit my answer...\nOver the years, some people have objected in the comments to my injunction not to move an already published tag. Of course, this piece of advice is contextual rather than universal; I don't doubt that good cases for moving a published tag exist. However, I stand firm in the belief that, as a general rule, the decision to move a published tag should be made deliberately and with extreme care.\nOne recent example comes to mind. Go 1.11 added experimental support for a module system that relies heavily on Git tags for versioning. Moving a tag in a Go module that has been published (on GitHub, say) would have disastrous consequences.\nBy doing so, you would break the contract established between you (the module author) and your users (those who depend on your module), because you would negate the guarantees that Go's module system intends to provide:\n\nModules record precise dependency requirements and create reproducible builds.\n\nThat's one sure way to piss people off.\nThis example may be enough to convince you that, at least in some cases, you shouldn't mindlessly move published tags. I rest my case."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-describe - Give an object a human readable name based on an available ref --exclude <pattern>"
},
{
"role": "assistant",
"content": "Do not consider tags matching the given glob(7) pattern, excluding\nthe \"refs/tags/\" prefix. If used with --all , it also does not consider\nlocal branches and remote-tracking references matching the pattern,\nexcluding respectively \"refs/heads/\" and \"refs/remotes/\" prefix;\nreferences of other types are never considered. If given multiple times,\na list of patterns will be accumulated and tags matching any of the\npatterns will be excluded. When combined with --match a tag will be\nconsidered when it matches at least one --match pattern and does not\nmatch any of the --exclude patterns. Use --no-exclude to clear and\nreset the list of patterns."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitlab docker registry with external nginx and omnibus\n\nI already run a gitlab server inside a docker container with an external nginx server inside an other docker container, so the gitlab nginx server is deactivated. Now I want to use the docker registry included in the gitlab server. \nI try to get the information from the administration manual: https://docs.gitlab.com/ee/administration/container_registry.html\nand use a fitted nginx config from linked file:\nhttps://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/registry-ssl\nto the gitlab.rb I added:\n... \nregistry_external_url 'url'\nregistry_nginx['enable'] = false\nregistry['enable'] = true\n...\n\nBut if I try to login (docker login url), I only get an 502 Bad Gateway error. I also tried some other configuration with ombinations, but gotting always the same error. Do anybody get it work? Need I to add more settings to the omnibus file or is it still not possible to use the gitlab internal docker registry with omnibus and external nginx?"
},
{
"role": "assistant",
"content": "ok i got it work. \n## Lines starting with two hashes (##) are comments with information.\n## Lines starting with one hash (#) are configuration parameters that can be uncommented.\n##\n###################################\n## configuration ##\n###################################\n\nupstream docker-registry {\n server <ip_of_gitlab_docker_container>:<port_of_gitlab_container>;\n}\n\n## Redirects all HTTP traffic to the HTTPS host\nserver {\n listen *:80;\n server_name sub.domain.tld;\n server_tokens off; ## Don't show the nginx version number, a security best practice\n return 301 https://$http_host:$request_uri;\n access_log /var/log/nginx/gitlab_registry_access.log;\n error_log /var/log/nginx/gitlab_registry_error.log;\n}\n\n\nserver {\n # If a different port is specified in https://gitlab.com/gitlab-org/gitlab-ce/blob/8-8-stable/config/gitlab.yml.example#L182,\n # it should be declared here as well\n listen *:443 ssl http2;\n server_name sub.domain.tld;\n server_tokens off; ## Don't show the nginx version number, a security best practice\n\n client_max_body_size 0;\n chunked_transfer_encoding on;\n\n ## Strong SSL Security\n ## https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/\n ssl on;\n ssl_certificate /etc/letsencrypt/live/sub.domain.tld/fullchain.pem;\n ssl_certificate_key /etc/letsencrypt/live/sub.domain.tld/privkey.pem;\n\n ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';\n ssl_protocols TLSv1 TLSv1.1 TLSv1.2;\n ssl_prefer_server_ciphers on;\n ssl_session_cache builtin:1000 shared:SSL:10m;\n ssl_session_timeout 5m;\n\n access_log /var/log/nginx/gitlab_registry_access.log;\n error_log /var/log/nginx/gitlab_registry_error.log;\n\n\n location /\n{\n # let Nginx know about our auth file\n proxy_pass http://docker-registry;\n proxy_set_header Host $host; # required for docker client's sake\n proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n }\n\n location /v2/ {\n # To add basic authentication to v2 use auth_basic setting plus\n # add_header\n add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always;\n proxy_pass http://docker-registry;\n proxy_set_header Host $http_host; # required for docker client's sake\n proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_read_timeout 900;\n }\n\n}\n\nMaybe the nginx configuration of Andrioshe also work, but I did some change and mix up with other configurations while trying. I think a configuration file for normal docker-regsitry will also work... will try it in future.\nBut the more important thing is the gitlab omnibus configuration.\nregistry_external_url 'https://sub.domain.tld'\nregistry['registry_http_addr'] = \"<ip_of_gitlab_docker_container>:<port_of_gitlab_container>\"\nregistry_nginx['enable'] = false\nregistry['enable'] = true\n\n\nIt is important to set the 'regsitry_http_addr' to the gitlab docker registry ip and port instead of localhost."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Merge different issues on github\nSometimes the developers open new issues regarding the same subject. \nIt will be great to have the possibility to merge the issues.\nIf it is possible in github, how can I do it?\nIf not, what is the best way to link different issues?"
},
{
"role": "assistant",
"content": "Currently, the simplest way to resolve this situation is to pick one of the issues to be the main one (whether the best documented, oldest, or whatever). Then, add a comment to the other issues linking to the main issue and close the duplicates.\nHere's an example.\nHere's another showing the \"Duplicate of #123\" syntax.\nAlternatively, you can leave the issues open and reference them all together in your commit messages: Example.\nI imagine that in the future, the team behind GitHub will make this process easier."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitLab CI Python black formatter says: would reformat, whereas running black does not reformat\n\nWhen I run GitLab CI on this commit\nwith this gitlab-ci.yml:\nstages:\n - format\n - test\n\nblack_formatting:\n image: python:3.6\n stage: format\n \n before_script:\n # Perform an update to make sure the system is up to date.\n - sudo apt-get update --fix-missing\n # Download miniconda.\n - wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; bash miniconda.sh -b -f -p $HOME/miniconda;\n # Ensure the (mini) conda environment can be activated.\n - export PATH=\"$HOME/miniconda/bin:$PATH\"\n # (Re)create the environment.yml file for the repository.\n - conda env create -q -f environment.yml -n checkstyle-for-bash --force\n # Activate the environment of the repository.\n - source activate checkstyle-for-bash\n\n script:\n # Verify the Python code is black formatting compliant.\n - black . --check --exclude '\\.venv/|\\.local/|\\.cache/|\\.git/'\n # Verify the Python code is flake8 formatting compliant.\n - flake8 .\n allow_failure: false\n\n\ntest:pytest:36:\n stage: test\n image: python:3.6\n script:\n # Ensure the (mini) conda environment can be activated.\n - export PATH=\"$HOME/miniconda/bin:$PATH\"\n # Activate the environment of the repository.\n - source activate checkstyle-for-bash\n # Run the python tests.\n - python -m pytest\n\nit outputs:\nRunning with gitlab-runner 14.8.0 (565b6c0b)\n on trucolrunner DS42qHSq\nPreparing the \"shell\" executor\n00:00\nUsing Shell executor...\nPreparing environment\n00:00\nRunning on pcname...\nGetting source from Git repository\n00:02\nFetching changes with git depth set to 20...\nReinitialized existing Git repository in /home/gitlab-runner/builds/DS42qHSq/0/root/checkstyle-for-bash/.git/\nChecking out 001577c3 as main...\nRemoving miniconda.sh\nSkipping Git submodules setup\nExecuting \"step_script\" stage of the job script\n02:55\n$ sudo apt-get update --fix-missing\nHit:1 http://nl.archive.ubuntu.com/ubuntu impish InRelease\nGet:2 http://security.ubuntu.com/ubuntu impish-security InRelease [110 kB]\nGet:3 http://nl.archive.ubuntu.com/ubuntu impish-updates InRelease [115 kB]\nHit:4 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease\nGet:5 http://nl.archive.ubuntu.com/ubuntu impish-backports InRelease [101 kB]\nHit:6 https://brave-browser-apt-release.s3.brave.com stable InRelease\nGet:7 http://security.ubuntu.com/ubuntu impish-security/main amd64 DEP-11 Metadata [20,3 kB]\nGet:8 http://security.ubuntu.com/ubuntu impish-security/universe amd64 DEP-11 Metadata [3.624 B]\nGet:9 http://nl.archive.ubuntu.com/ubuntu impish-updates/main amd64 DEP-11 Metadata [25,8 kB]\nGet:10 http://nl.archive.ubuntu.com/ubuntu impish-updates/universe amd64 DEP-11 Metadata [35,4 kB]\nGet:11 http://nl.archive.ubuntu.com/ubuntu impish-updates/multiverse amd64 DEP-11 Metadata [940 B]\nGet:12 http://nl.archive.ubuntu.com/ubuntu impish-backports/universe amd64 DEP-11 Metadata [16,4 kB]\nFetched 428 kB in 2s (235 kB/s)\nReading package lists...\n$ wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; bash miniconda.sh -b -f -p $HOME/miniconda;\nPREFIX=/home/gitlab-runner/miniconda\nUnpacking payload ...\nCollecting package metadata (current_repodata.json): ...working... done\nSolving environment: ...working... done\n# All requested packages already installed.\ninstallation finished.\n$ export PATH=\"$HOME/miniconda/bin:$PATH\"\n$ conda env create -q -f environment.yml -n checkstyle-for-bash --force\nCollecting package metadata (repodata.json): ...working... done\nSolving environment: ...working... done\nPreparing transaction: ...working... done\nVerifying transaction: ...working... done\nExecuting transaction: ...working... done\nInstalling pip dependencies: ...working... done\n$ source activate checkstyle-for-bash\n$ black . --check --exclude '\\.venv/|\\.local/|\\.cache/|\\.git/'\nwould reformat src/arg_parser.py\nwould reformat src/helper_text_parsing.py\nOh no! 💥 💔 💥\n2 files would be reformatted, 10 files would be left unchanged.\nERROR: Job failed: exit status 1\n\nHowever, if I run black src/** on the GitHub repository, black returns:\n~/git/checkstyle-for-bash$ git pull\nAlready up to date.\n(base) some@name:~/git/checkstyle-for-bash$ black src/**\nAll done! ✨ 🍰 ✨\n8 files left unchanged.\n\nJust in case I did not clone the right repository, I also manually copy-pasted the content of the src/arg_parser.py file from GitLab into ~/git/checkstyle-for-bash/src/arg_parser.py and ran black again. However, the output is the same, it does not change anything.\nFor completeness, this is the content of the src/arg_parser.py file:\n# This is the main code of this project nr, and it manages running the code and\n# outputting the results to LaTex.\nimport argparse\n\n\ndef parse_cli_args():\n # Instantiate the parser\n parser = argparse.ArgumentParser(description=\"Optional app description\")\n\n # Include argument parsing for default code.\n # Allow user to load a graph from file.\n parser.add_argument(\n \"--ggl\",\n dest=\"google_style_guide\",\n action=\"store_true\",\n help=(\n \"boolean flag, determines whether the Google Style Guide for \"\n \"Bash rules are followed.\"\n ),\n )\n\n # Allow user to specify an infile.\n parser.add_argument(\"infile\", nargs=\"?\", type=argparse.FileType(\"r\"))\n\n # Specify default argument values for the parser.\n parser.set_defaults(google_style_guide=True,)\n\n # Load the arguments that are given.\n args = parser.parse_args()\n return args\n\n\nQuestion\nWhat could be causing the GitLab CI to say the files would be reformatted by black (even though the files are not reformatted when running black on them (on the same device (in a different conda environment)))?\nSetup\nI run my own GitLab CI on the same device on which I test the conda black commands. The GitLab CI copies the GitHub commits of a repository, one at a time, runs its CI on it, and then reports the results back to GitHub.\nI am currently not able to expose my GitLab server on clearnet as I am behind a gateway that I currently do not control.\nDoubts\nI am fairly certain it is a \"silly\" mistake from my side, however I have not yet been able to figure out what it is. Especially since I manually copy pasted the GitLab file content of the src/arg_parser.py file twice, and ran black twice to verify black indeed does not change \"that\" file. Also, to be sure it was not a trailing newline or anything, I used the copy button with the mouse, instead of manual selection:\n\nAdditionally, the file is flake8 compliant. My current guess is that somehow the CI is not ran on the most recent commit of that repository. However, to verify that I clicked on the GitLab of the failed commit, which indeed redirects to the \"05e85fd54f93ccfc427023b21f9cdb0c0cd6db2e\" commit (copy) in GitLab:\n It is from this commit that I copy-pasted the src/arg_parser.py file twice.\nAnother guess would be that the gitlab-ci.yml loads a miniconda environment whereas my local version of black uses a full conda environment. Perhaps they have a different newline character that would lead to a formatting difference. (Even though I doubt that would be the case).\nIssue\nI ran the CI again whilst include the black . --diff command in the gitlab-ci.yml script, and the difference is between a:\n''' Return\n\nand:\n'''Return\n\nas is displayed in the accompanying output:\n$ black . --diff --exclude '\\.venv/|\\.local/|\\.cache/|\\.git/'\n--- src/arg_parser.py 2022-04-03 10:13:10.751289 +0000\n+++ src/arg_parser.py 2022-04-03 11:11:26.297995 +0000\n@@ -24,10 +24,12 @@\n \n # Allow user to specify an infile.\n parser.add_argument(\"infile\", nargs=\"?\", type=argparse.FileType(\"r\"))\n \n # Specify default argument values for the parser.\n- parser.set_defaults(google_style_guide=True,)\n+ parser.set_defaults(\n+ google_style_guide=True,\n+ )\n \n # Load the arguments that are given.\n args = parser.parse_args()\n return args\nwould reformat src/arg_parser.py\n--- src/helper_text_parsing.py 2022-04-02 19:35:45.142619 +0000\n+++ src/helper_text_parsing.py 2022-04-03 11:11:26.342908 +0000\n@@ -5,11 +5,11 @@\n def add_two(x):\n return x + 2\n \n \n def get_function_line_nrs(filecontent, rules):\n- \"\"\" Returns two lists containing the starting and ending line numbers of\n+ \"\"\"Returns two lists containing the starting and ending line numbers of\n the functions respectively.\n \n :param filecontent: The content of the bash file that is being analysed.\n :param rules: The Bash formatting rules that are chosen by the user.\n \"\"\"\nwould reformat src/helper_text_parsing.py\nAll done! ✨ 🍰 ✨\n2 files would be reformatted, 10 files would be left unchanged.\n\nI am not quite sure exactly why this happens, as I thought python black would always converge to the exact same formatting for a given valid python file. I assume it is because two different black versions are used between the miniconda environment and the anaconda environment on the same device.\nTo test this hypothesis I am including a black --version command in the gitlab-ci.yml."
},
{
"role": "assistant",
"content": "The miniconda environment in the GitLab CI used python black version:\nblack, 22.3.0 (compiled: yes)\n\nWhereas the local environment used python black version:\nblack, version 19.10b0\n\nUpdating the local black version, pushing the formatted code according to the latest python black version, and running the GitLab CI on that GitHub commit resulted in a successful GitLab CI run."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc Various ways to check your working tree"
},
{
"role": "assistant",
"content": "$ git diff (1) $ git diff --cached (2) $ git diff HEAD (3) $ git diff AUTO_MERGE (4) Changes in the working tree not yet staged for the next commit. Changes between the index and your last commit; what you\nwould be committing if you run git commit without -a option. Changes in the working tree since your last commit; what you\nwould be committing if you run git commit -a Changes in the working tree you’ve made to resolve textual\nconflicts so far."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Recover from inadvertent skip during rebase\nI just tried to rebase a very old branch with a minor modification onto my master.\nThere was a problem with merging just one of the three files involved, so I did an unthinking --skip, thinking that it would just skip that file, but as it happened, it seems to have skipped all my changes, and rolled forwards. So now the rebase is finished, and my changes seem to have disappeared. \nI've seen the question about undoing rebase, but it's all greek to me, I see the reflog, but I don't know which commit the branch was attached to before the rebase.\nIn any case, I don't really need to undo the rebase, I just want to be able to recover the changes in the two files. Is there anyway to do this properly (failing this, I'll just have to restore yesterday's backup of my repository and pick the bits out by hand)."
},
{
"role": "assistant",
"content": "First, make a tarball of your git working folder. This makes it easier to try it several times.\nLets assume the following happened\n\ngit checkout another-old-branch\ngit rebase master\nsome problems (which you skipped)\n\nat this point you are now still in another-old-branch and your reflog shows you:\n6f8348f HEAD@{0}: rebase: <commit message of last commit in another-old-branch>\ne547ec0 HEAD@{1}: checkout: moving from another-old-branch to e547ec0d2a558d189464fc57192066b34ec5f28f^0\n65cedf8 HEAD@{2}: checkout: moving from master to another-old-branch\n\nImagine that branchs are like symlinks (or pointers), all we have to do is let the branch 'another-old-branch' point back on the old commit-id. the old commit is is still there, and it wasn't touched by your rebase. kinda: 'hey git, another-old-branch is e547ec0d2, forget everything else that happened' \nIn our case here that was e547ec0d2a558d189464fc57192066b34ec5f28f, so what we have to do now is\n\ngit checkout another-old-branch # if you aren't already there\ngit reset --hard e547ec0d2a558d189464fc57192066b34ec5f28f\n\nnow your branch is back to normal. And you can retry your rebase.\nPlease note that your reflog is by now a little bit more complicated than aboves example. but it should stil lbe there somewhere... \ngood luck!"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options diff.colorMovedWS"
},
{
"role": "assistant",
"content": "When moved lines are colored using e.g. the diff.colorMoved setting,\nthis option controls the <mode> how spaces are treated.\nFor details of valid modes see --color-moved-ws in git-diff ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-update-index - Register file contents in the working tree to the index --remove"
},
{
"role": "assistant",
"content": "If a specified file is in the index but is missing then it’s\nremoved.\nDefault behavior is to ignore removed files."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitglossary - A Git Glossary tree object"
},
{
"role": "assistant",
"content": "An object containing a list of file names and modes along\nwith refs to the associated blob and/or tree objects. A tree is equivalent to a directory ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Better way of getting a GIT commit message by short hash?\nI am currently getting my commit message for a certain commit hash by using this below:\nhash='b55da97'\ngit log --pretty=oneline ${hash} | grep \"${hash}\" | awk '{ print $2 }'\n\nThese seems extremely inefficient though. Is there a smarter or cheaper way to do this, or am I stuck with grepping and awking?"
},
{
"role": "assistant",
"content": "git log takes (among other things):\n\n-n num to limit the number of commits shown: choose 1 (and if num is 9 or less you can just write -num, hence, -1, for short)\n--pretty=format:string with directives to change the log output format. The %s directive gets the commit \"subject\", which is what you also get with oneline.\n\nHence: git log -n 1 --pretty=format:%s $hash (or git log -1 --pretty=format:%s) will do the trick here.\nFor a complete list of format directives, see the git log documentation, under \"PRETTY FORMATS\" (about halfway down)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git branch deletion\nIn Git, what does \"deletion\" of a branch mean?\nWill it be gone from the repository? Or will it still be navigable to via git branch?\nWhat I really want to do is mark a branch as \"dead end\", i.e., the branch is so far from master, that nobody should use it as a starting point, though there were some good ideas down that branch, so we'd like to keep it, for reference."
},
{
"role": "assistant",
"content": "You can delete the branch, but tag it first, so that it's history doesn't disappear. This way, the branch doesn't show up in the branch list, which should hopefully deter people from working on it, but the work won't be permanently erased (even after garbage collection is run). For instance, whenever I have a branch that has become irrelevant, but I'm not prepared to permanently delete it, I tag it as \"archive/<branch-name>\".\nWhile on master or some other branch:\ngit tag archive/foo foo\ngit branch -D foo\n\nThis creates a tag named archive/foo from the foo branch before deleting foo. You can also add a message to the tag, that explains what is in the branch, why it existed, why it's now a dead end, etc.\ngit tag -m 'Foo is deprecated in favor of bar' archive/foo foo\n\nThe ability to record why a branch is being deprecated is perhaps an advantage of tagging versus moving branches to an alternate namespace.\nIf you ever need to resurrect a branch that has been archived this way, it's as simple as:\ngit branch foo archive/foo\ngit tag -d archive/foo # Optional\n\nNow the branch is back as though it was never deleted."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git rebase: \"error: cannot stat 'file': Permission denied\"\nI'm using git, and made a small commit followed by a large one. I decided to use git rebase to squash the two commits together before pushing them. (I've never done this before.)\nSo I did:\ngit rebase -i HEAD~2\nThis gave me my editor, where I chose to pick the earlier commit and squash the later one. When I saved, git said:\n\nerror: cannot stat 'filename': Permission denied\nCould not apply sha1 for later commit... initial line of text for that commit\n\nNow:\n\nNeither commit appears when I do git log.\ngit status tells me I'm \"Not currently on any branch.\"\nOne file is listed as modified and in the index, and two files are listed as untracked. My first commit had just one file (I think), and my second commit had a good dozen.\n\nWhat happened!? How do I fix it?"
},
{
"role": "assistant",
"content": "Try closing any programs that have the folder open, such as editors, explorer windows, command prompts, and FTP programs. This always fixes the issue for me on Windows."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fetch - Download objects and refs from another repository --shallow-exclude=<revision>"
},
{
"role": "assistant",
"content": "Deepen or shorten the history of a shallow repository to\nexclude commits reachable from a specified remote branch or tag.\nThis option can be specified multiple times."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git in Powershell saying 'Could not find ssh-agent'\nI have git installed and it works great in the command prompt, but when I open up powershell it gives me this warning:\nWARNING: Could not find ssh-agent\n\nI have pageant running and loaded with my private key. This works in all the gui tools and the command prompt but not in Powershell. \nWhat's going on?"
},
{
"role": "assistant",
"content": "For those looking for a detailed explanation have a read of this blog post. Below is a quote from the blog post. Ultimately the ssh-agent.exe needs to be in the path, or resolved some other way.\nEDIT:\nIt appears most of the people don't bother reading the linked blog and the original extract did not quote the full solution, so I've expanded the quote from the blog below.\nThere are numerous ways to resolve the error, based on the likes to all other answers. One known to work is quoted below. Scan though other answers they may be more appropriate for you.\n\nWhen I restarted my PowerShell prompt, it told me it could not start SSH Agent.\nIt turns out that it was not able to find the “ssh-agent.exe” executable. That file is located in C:\\Program Files (x86)\\Git\\bin. but that folder isn’t automatically added to your PATH by msysgit.\nIf you don’t want to add this path to your system PATH, you can update your PowerShell profile script so it only applies to your PowerShell session. Here’s the change I made.\n$env:path += \";\" + (Get-Item \"Env:ProgramFiles(x86)\").Value + \"\\Git\\bin\"\nOn my machine that script is at:\nC:\\Users\\Haacked\\Documents\\WindowsPowerShell\\Microsoft.Powershell_profile.ps1"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to solve the requested URL returned error: 403 in git repository\nI have multiple accounts in git I committed code three weeks back with this account. I'll unable to pull my code . I was getting The requested \nURL returned error: 403\nI'll try Pushing to Git returning Error Code 403 fatal: HTTP request failed\n but I couldn't solved my error\ngit -c diff.mnemonicprefix=false -c core.quotepath=false fetch origin\nremote: Forbidden\nfatal: unable to access \n'https://[email protected]/chantidurgam/patanjali.git/': The requested \nURL returned error: 403\n\nCompleted with errors, see above."
},
{
"role": "assistant",
"content": "What needs to be checked before anything else is the access level, which should be set to write. This can happen if you were added to the repo by someone else, and they forgot to grant you the required permissions."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to contribute on github anonymously via Tor?\nI would like to contribute anonymously to projects on github. Not to cause mischief, more in the spirit of anonymous donations. \nThe tool of choice for being anonymous online seems to be TOR, which works well for almost anything you can do in a browser. However, to contribute on github, it appears necessary to use the command line interface, or the Mac app. \nHow can I channel my git operations in this setup through Tor? And how can I verify that this is actually what is happening?\nEdit: please note the difference between pseudonymous (with a fake e-mail address) and anonymous (with an IP address that cannot be associated with an identity). Pseudonymous access to github is trivial; however, I am looking for anonymous access."
},
{
"role": "assistant",
"content": "None of these answers give a full useable workflow, I want to git push, not send an email! Here's how to do it properly but there's a bit of setup required. Instructions are for OSX\n#Publishing anonymously to github with tor+ssh\n\nDownload tor browser bundle AND the tor command line proxy\n brew install tor\n brew install --cask tor-browser\n\n\n\n1.1 In tor browser, Create a new email address ( I used hmamail).\n1.2 In tor browser, Create a new github account\n\nCreate a new ssh key, only for tor with your new email address\nssh-keygen -t rsa -b 4096 -C \"[email protected]\"\n\n\n\n2.1. Give it a name like: ~/.ssh/private_tor_rsa\n2.2. In github, go to SSH and PGP keys and add a new SSH key, make title memorable.\n2.3. In github, set Key to the public key you've just createdclip < ~/.ssh/private_tor_rsa.pub\n\nIn github, create an empty repository, let's call it ByteCoin, don't initialise it with a readme.\n\nEdit the ssh config file ~/.ssh/config (create if it doesn't exist)\nHost github-tor-alias\nUser git\nHostName github.com\nIdentitiesOnly yes\nIdentityFile ~/.ssh/tor_only_rsa\nProxyCommand nc -X 5 -x 127.0.0.1:9050 %h %p\n\n\nYou've created a hostname called github-tor-alias and tells ssh to use a proxy on localhost:9050 and use the tor_only_rsa key to authenticate.\n\nSetup the config for your new project to use the tor proxy and credentials.\nmkdir secret-project\ncd secret-project\ngit init\n\ngit config --add user.name satoshi_2\ngit config --add user.email [email protected]\n\n\n\nThis next line is bloody important\n5.1. note the ssh://git and github-tor-alias\n git remote add origin ssh://git@github-tor-alias/staoshi_2/ByteCoin.git\n\n\nRemember how you installed the tor command line proxy? start it as a service. It listens on localhost:9050\nbrew services start tor\n\n\nAre you ready? Try pushing to github:\ngit push origin master\n\n\n\nDid it work? Go and double check everything, have I missed something? please edit this answer!\nCongratulations\nbreath that free air and get creating!\nSo what have we just done? we've created a new identity who is associated only with the tor network, as far as github.com is concerned, you are staoshi_2 and could be anywhere in the world.\ntor runs a proxy on 127.0.0.1:9050, because we setup a ProxyCommand in the ~/.ssh/config file, all of your traffic goes through the tor proxy, git uses your new ssh key because you added IdentityFile and IdentitiesOnly to your ~/.ssh/config file.\nPowerful stuff.\nLet's double check that you're really anonymous\n\nstop tor and try to git push again, it had better fail!\nssh_exchange_identification: Connection closed by remote host\nfatal: Could not read from remote repository.\n\n\n\n8.1. If that git push succeeded well guess what, you weren't using tor, github.com knows your IP, figure out how to get it working and then start again with a new email address.\n9. Happy freedom!\nanon."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker GIT_GLOB_PATHSPECS"
},
{
"role": "assistant",
"content": "Setting this Boolean environment variable to true will cause Git to treat all\npathspecs as glob patterns (aka \"glob\" magic)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-list - Lists commit objects in reverse chronological order --boundary"
},
{
"role": "assistant",
"content": "Output excluded boundary commits. Boundary commits are\nprefixed with - ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I get the latest tag name in current branch in Git?\nWhat's the simplest way to get the most recent tag in Git?\ngit tag a HEAD\ngit tag b HEAD^^\ngit tag c HEAD^\ngit tag\n\noutput:\na\nb\nc\n\nShould I write a script to get each tag's datetime and compare them?"
},
{
"role": "assistant",
"content": "To get the most recent tag (example output afterwards):\ngit describe --tags --abbrev=0 # 0.1.0-dev\n\nTo get the most recent tag, with the number of additional commits on top of the tagged object & more:\ngit describe --tags # 0.1.0-dev-93-g1416689\n\nTo get the most recent annotated tag:\ngit describe --abbrev=0"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Best way to deploy react app with gitlab-ci?\n\nI'm just getting started figuring out gitlab CI/CD. I have my own gitlab instance, and a couple runners, 1 shared, 1 project specific, both using docker engine.\nCurrently my staging server is its own VM that it hosts with docker-compose. I usually deploy to this server with a bare git repo, and just keep the build files in git.\nBut I wanted to switch to a CI/CD model, so I tried this as my .gitlab-ci.yml:\nimage: node\n\nstages:\n- build\n- stage\n\nbuild_frontend:\n stage: build\n script:\n - cd ./src/frontend\n - npm install && npm audit fix\n # CI=false set to ignore warnings as errors\n - CI=false npm run build\n artifacts:\n paths:\n - ./src/frontend/build\n tags:\n - projectname\n\nBut I'm sort of lost on how to actually deploy the build. What would the best way be to get the files onto the staging server, which is just a VM."
},
{
"role": "assistant",
"content": "You can take some clues from how GitLab itself uses its own CI, as described in \"How to use GitLab CI for Vue.js\":\nThey have a dedicated deploy step:\nbuild site:\n image: node:6\n stage: build\n script:\n - npm install --progress=false\n - npm run build\n artifacts:\n expire_in: 1 week\n paths:\n - dist\n\nunit test:\n image: node:6\n stage: test\n script:\n - npm install --progress=false\n - npm run unit\n\ndeploy:\n image: alpine\n stage: deploy\n script:\n - apk add --no-cache rsync openssh\n - mkdir -p ~/.ssh\n - echo \"$SSH_PRIVATE_KEY\" >> ~/.ssh/id_dsa\n - chmod 600 ~/.ssh/id_dsa\n - echo -e \"Host *\\n\\tStrictHostKeyChecking no\\n\\n\" > ~/.ssh/config\n - rsync -rav --delete dist/ [email protected]:/your/project/path/\n\nSo if you can package and scp your app, you can deploy it to your VM."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-list - Lists commit objects in reverse chronological order %P"
},
{
"role": "assistant",
"content": "parent hashes"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git merge strategy 'theirs' is not resolving modify/delete conflict\nWhen performing a git merge with the following options:\ngit merge -X theirs master\nThere are occasionally conflicted files like so:\n\nCONFLICT (modify/delete): File_A.java deleted in master and modified\n in HEAD. Version HEAD of File_A.java left in tree.\n\nHowever, I would like for the -X theirs option to be recognized in these cases, and use the theirs version of the change, which is for the file to be deleted.\nIs there a reason this type of conflict is not automatically resolved, especially since I'm providing a specific merge strategy that suggests it should remove the file?\nFurther, how (if possible) can I update my merge command to use the theirs version of this type of conflict?"
},
{
"role": "assistant",
"content": "A bit late but might be useful, you can resolve this type of conflict with:\ngit merge -X theirs master\ngit diff --name-only --diff-filter=U | xargs git rm\n\nBasically it means \"delete all unmerged files\" during the conflict resolution."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Forking Git repository from GitHub to GitLab\nSuppose that I would like to implement a fix to a project of someone else. That project resides on GitHub.\nI could create a fork on GitHub and implement the fix.\nHowever, I would like to create my fork on GitLab rather than on GitHub.\nIs that possible? How?\nI have read this article:\nhttps://about.gitlab.com/2016/12/01/how-to-keep-your-fork-up-to-date-with-its-origin/\nAnyway, I am not sure what should I do in my case.\n\nShould I just create a fork on GitLab of the project from GitHub somehow?\nOr should I create a mirror on GitLab of the project from GitHub?\nOr should I create a mirror on GitLab and then fork the mirror?\nOr should I do something completely different?\n\nWhat is the correct approach.\nThanks.\nUPDATE\nRepository mirroring on GitLab does not make sense probably. I can create a mirror of MY GitHub repository on GitLab but I cannot create a mirror of a repository of someone else.\nhttps://docs.gitlab.com/ee/user/project/repository/mirror/\nThis is what I have done so far:\nI have cloned the original GitHub project to my local machine. I have commited the fix to a new branch in my local repository. I have created an empty project on GitLab. I have set origin in my local repository to that empty project on GitLab and pushed both branches to GitLab. I have set upstream in my local repository to the GitHub repository.\nWhen I want to get new commits from the original GitHub repository to the repository on GitLab (i.e. sync the repositories), I can do this using my local repo as an intermediate step. However, there is no direct connection between the repo on GitHub and the repo on GitLab. Is my setup correct? Is there any difference if I make a fork on GitHub?"
},
{
"role": "assistant",
"content": "If you just want to track changes, first make an empty repository in GitLab (or whatever else you may be using) and clone it to your computer.\nThen add the GitHub project as the \"upstream\" remote with:\ngit remote add upstream https://github.com/user/repo\n\nNow you can fetch and pull from the upstream should there be any changes. (You can also push or merge to it if you have access rights.)\ngit pull upstream master\n\nFinally, push back to your own GitLab repository:\ngit push origin master\n\nIf you don't want to manually pull upstream/push origin, GitLab offers a mirroring ability in Settings => Repository => Mirroring repositories."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index --compact-summary"
},
{
"role": "assistant",
"content": "Output a condensed summary of extended header information such\nas file creations or deletions (\"new\" or \"gone\", optionally \"+l\"\nif it’s a symlink) and mode changes (\"+x\" or \"-x\" for adding\nor removing executable bit respectively) in diffstat. The\ninformation is put between the filename part and the graph\npart. Implies --stat ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options status.renameLimit"
},
{
"role": "assistant",
"content": "The number of files to consider when performing rename detection\nin git-status and git-commit . Defaults to\nthe value of diff.renameLimit."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker GIT_TRACE_FSMONITOR"
},
{
"role": "assistant",
"content": "Enables trace messages for the filesystem monitor extension.\nSee GIT_TRACE for available trace output options."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What's the difference between categories and tags in Jekyll?\n\nBoth of their elements can be accessed by for..in, and the way of adding categories and tags are the same. So, what's the difference between categories and tags in Jekyll?"
},
{
"role": "assistant",
"content": "It seems to me that the only important difference is that categories can be used in the post url - a post inside the \"beer\" and \"food\" categories, by default, will have this url:\n/food/beer/2008/09/09/foo-bar.html\n\nInstead of this one:\n/2008/09/09/foo-bar.html\n\nSee the post tests for details\nTags have no influence in the urls, at least according to their tests."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Getting a list of commits along with the commit message and hash in Git\nI have a project in Git. What I want is a list of only the commit messages and the hashes between two commits and store it in a text file. Is there any command that does this ? \nThanks."
},
{
"role": "assistant",
"content": "git log --pretty=oneline commit1...commit2 > file"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to maintain multiple bitbucket accounts with multiple ssh keys in the same system\nI have multiple Git accounts one is my personal use and one is for company use. Both accounts source need to be activated from my laptop.\nHere I generated two ssh keys like id_rsa.pub,id_benwork_rsa.pub \nand I configured the config of git as \nHost sfsworkdid\n HostName bitbucket.org\n IdentityFile ~/.ssh/id_rsa\nHost workdid\n HostName bitbucket.org\n IdentityFile ~/.ssh/id_benwork_rsa\n\nSo here is my problem: while pushing to any repo git asking the first ssh_key passphrase.\nEverytime I am changing the user.name in git config as git config user.name \"mybitbucketusername\".\nSo please tell me how to maintain multiple git accounts with multiple ssh keys in the same system\nI tried How to work with multiple ssh keys, Multiple bitbucket accounts\nbut no use\npush using multiple account / multiple identity on github / bitbucket is somewhat helpful to reach up to now"
},
{
"role": "assistant",
"content": "Create multiple identities for Mac OSX, GitBash, and Linux\nYou should at this point already have created at least a single default identity. To see if you have a default identity already, list the contents of your .ssh directory. Default identity files appear as a id_encrypt and id_encrypt.pub pair. The encrypt value is either rsa or dsa. Use the ssh-keygen command to create a new identity. In the example below, the identity is named personalid.\n$ ssh-keygen -f ~/.ssh/personalid -C \"personalid\"\nGenerating public/private rsa key pair.\nEnter passphrase (empty for no passphrase): \nEnter same passphrase again: \nYour identification has been saved in /Users/manthony/.ssh/personalid.\nYour public key has been saved in /Users/manthony/.ssh/personalid.pub.\nThe key fingerprint is:\n7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 personalid\nThe key's randomart image is:\n+--[ RSA 2048]----+\n| |\n| |\n| .|\n| Eo|\n| . S . ..|\n| . . o . ... .|\n| . = = ..o o |\n| . o X ... . .|\n| .ooB.o .. |\n+-----------------+\n\nIf you have multiple Bitbucket accounts, you need to generate a new public/private key pair for each account.\nCreate a SSH config file\nWhen you have multiple identity files, create a SSH config file mechanisms to create aliases for your various identities. You can construct a SSH config file using many parameters and different approaches. The format for the alias entries use in this example is:\nHost alias\nHostName bitbucket.org\nIdentityFile ~/.ssh/identity\n\nTo create a config file for two identities (workid and personalid), you would do the following:\n\nOpen a terminal window.\n\nEdit the ~/.ssh/config file. If you don't\nhave a config file, create one.\n\nAdd an alias for each identity\ncombination for example:\nHost workid\n HostName bitbucket.org\n IdentityFile ~/.ssh/workid\nHost personalid\n HostName bitbucket.org\n IdentityFile ~/.ssh/personalid\n\n\nClose and save the file.\n\n\nNow, you can substitute the alias for portions of the repository URL address as below:\n[email protected]:accountname/reponame.git -> git@alias:accountname/reponame.git\nLoad each key into the appropriate Bitbucket account\n\nEnsure the ssh-agent is running and loaded with your keys\n\nClone a repository using SSH and your alias configuration\nTo clone a repository with one of multiple SSH identities that you configured, you clone the repo and using your alias in the SSH URL. To try this for yourself, log into Bitbucket and do the following:\n\nNavigate to the repository Overview.\nDisplay the SSH URL.\nFor example, ssh URL as:\n[email protected]:accountname/reponame.git\nthen clone the repository using:\ngit clone git@personalid:accountname/reponame.git\n\nThis refers to official solution Configure multiple SSH identities for GitBash, Mac OSX, & Linux, It works fine for me!"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs -L<start>,<end>:<file> -L:<funcname>:<file>"
},
{
"role": "assistant",
"content": "Trace the evolution of the line range given by <start>,<end> ,\nor by the function name regex <funcname> , within the <file> . You may\nnot give any pathspec limiters. This is currently limited to\na walk starting from a single revision, i.e., you may only\ngive zero or one positive revision arguments, and <start> and <end> (or <funcname> ) must exist in the starting revision.\nYou can specify this option more than once. Implies --patch .\nPatch output can be suppressed using --no-patch , but other diff formats\n(namely --raw , --numstat , --shortstat , --dirstat , --summary , --name-only , --name-status , --check ) are not currently implemented. <start> and <end> can take one of these forms: number If <start> or <end> is a number, it specifies an\nabsolute line number (lines count from 1). /regex/ This form will use the first line matching the given\nPOSIX regex. If <start> is a regex, it will search from the end of\nthe previous -L range, if any, otherwise from the start of file.\nIf <start> is ^/regex/ , it will search from the start of file.\nIf <end> is a regex, it will search\nstarting at the line given by <start> . +offset or -offset This is only valid for <end> and will specify a number\nof lines before or after the line given by <start> . If :<funcname> is given in place of <start> and <end> , it is a\nregular expression that denotes the range from the first funcname line\nthat matches <funcname> , up to the next funcname line. :<funcname> searches from the end of the previous -L range, if any, otherwise\nfrom the start of file. ^:<funcname> searches from the start of\nfile. The function names are determined in the same way as git diff works out patch hunk headers (see Defining a custom hunk-header in gitattributes )."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to download GitHub Release from private repo using command line\n\nGitHub guide explains 2 way to authorize but looks neither of those works with the Release files.\nas a result of:\ncurl -u 'username' -L -o a.tgz https://github.com/company/repository/releases/download/TAG-NAME/A.tgz\n\nThere always is something like\n<!DOCTYPE html>\n<!--\nHello future GitHubber! ..."
},
{
"role": "assistant",
"content": "To download release file from private repo, you can use Personal access token which can be generated at settings/tokens with Full control of private repositories scope.\nThen download the asset with curl command (change with appropriate values):\ncurl -vLJO -H 'Authorization: token my_access_token' 'https://api.github.com/repos/:owner/:repo/releases/assets/:id'\n\nor if you're using an OAuth app, use:\ncurl -u my_client_id:my_client_secret https://api.github.com/repos/:owner/:repo/releases/assets/:id\n\nwhere:\n\n:owner is your user or organisation username;\n:repo is your repository name;\n:id is your asset id, can be found in tag release URL, like:\nhttps://api.github.com/repos/:owner/:repo/releases/tags/:tag \n\n:token is your personal access token (can be created at /settings/tokens;\n\nNote: Using access_token as a query param is deprecated.\nSee: Repositories API v3 at GitHub\n\nHere is the Bash script which can download asset file given specific name of file:\n#!/usr/bin/env bash\n# Script to download asset file from tag release using GitHub API v3.\n# See: http://stackoverflow.com/a/35688093/55075 \nCWD=\"$(cd -P -- \"$(dirname -- \"$0\")\" && pwd -P)\"\n\n# Check dependencies.\nset -e\ntype curl grep sed tr >&2\nxargs=$(which gxargs || which xargs)\n\n# Validate settings.\n[ -f ~/.secrets ] && source ~/.secrets\n[ \"$GITHUB_API_TOKEN\" ] || { echo \"Error: Please define GITHUB_API_TOKEN variable.\" >&2; exit 1; }\n[ $# -ne 4 ] && { echo \"Usage: $0 [owner] [repo] [tag] [name]\"; exit 1; }\n[ \"$TRACE\" ] && set -x\nread owner repo tag name <<<$@\n\n# Define variables.\nGH_API=\"https://api.github.com\"\nGH_REPO=\"$GH_API/repos/$owner/$repo\"\nGH_TAGS=\"$GH_REPO/releases/tags/$tag\"\nAUTH=\"Authorization: token $GITHUB_API_TOKEN\"\nWGET_ARGS=\"--content-disposition --auth-no-challenge --no-cookie\"\nCURL_ARGS=\"-LJO#\"\n\n# Validate token.\ncurl -o /dev/null -sH \"$AUTH\" $GH_REPO || { echo \"Error: Invalid repo, token or network issue!\"; exit 1; }\n\n# Read asset tags.\nresponse=$(curl -sH \"$AUTH\" $GH_TAGS)\n# Get ID of the asset based on given name.\neval $(echo \"$response\" | grep -C3 \"name.:.\\+$name\" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')\n#id=$(echo \"$response\" | jq --arg name \"$name\" '.assets[] | select(.name == $name).id') # If jq is installed, this can be used instead. \n[ \"$id\" ] || { echo \"Error: Failed to get asset id, response: $response\" | awk 'length($0)<100' >&2; exit 1; }\nGH_ASSET=\"$GH_REPO/releases/assets/$id\"\n\n# Download asset file.\necho \"Downloading asset...\" >&2\ncurl $CURL_ARGS -H \"Authorization: token $GITHUB_API_TOKEN\" -H 'Accept: application/octet-stream' \"$GH_ASSET\"\necho \"$0 done.\" >&2\n\nBefore running, you need to set your GITHUB_API_TOKEN with your GitHub token (see: /settings/tokens at GH). This can be placed in your ~/.secrets file, like:\nGITHUB_API_TOKEN=XXX\n\nExample script usage:\n./get_gh_asset.sh :owner :repo :tag :name\n\nwhere name is your filename (or partial of it). Prefix script with TRACE=1 to debug it.\n\nIn case you wonder why curl fails sometimes with (as mentioned in other answer):\n\nOnly one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified.\n\nwhen running like:\ncurl -vLJ -H 'Authorization: token <token>' -H 'Accept: application/octet-stream' https://api.github.com/repos/:owner/:repo/releases/assets/<id>\n\nthis is because you're specifying multiple mechanism at the same time, so S3 server doesn't know which one to use, therefore you have to choose only one, such as:\n\nX-Amz-Algorithm query parameter\nSignature query string parameter (X-Amz-Signature)\nAuthorization header (Authorization: token <token>)\n\nand since GitHub redirects you from asset page (when requesting application/octet-stream), it populates credentials automatically in query string and since curl is passing over the same credentials in the request header (which you've specified), therefore they're conflicting. So as for workaround you can use access_token instead."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Is it possible to Git merge / push using Jenkins pipeline\nI am trying to create a Jenkins workflow using a Jenkinsfile. All I want it to do is monitor the 'develop' branch for changes. When a change occurs, I want it to git tag and merge to master. I am using the GitSCM Step but the only thing that it appears to support is git clone. I don't want to have to shell out to do the tag / merge but I see no way around it. Does anyone know if this is possible? I am using BitBucket (on-prem) for my Git server."
},
{
"role": "assistant",
"content": "If what you're after are the git credentials you can use the SSH Agent plugin like in this link: https://issues.jenkins-ci.org/browse/JENKINS-28335?focusedCommentId=260925&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-260925\nsshagent(['git-credentials-id']) {\n sh \"git push origin master\"\n}"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "\"git rebase origin\" vs.\"git rebase origin/master\"\nI don't get the difference between git rebase origin and git rebase origin/master. In my case I cloned a git repository twice. In the first clone I have to use git rebase origin and in the other clone I must use git rebase origin/master.\nAn example: http://paste.dennis-boldt.de/2011/05/11/git-rebase"
},
{
"role": "assistant",
"content": "git rebase origin means \"rebase from the tracking branch of origin\", while git rebase origin/master means \"rebase from the branch master of origin\"\nYou must have a tracking branch in ~/Desktop/test, which means that git rebase origin knows which branch of origin to rebase with. If no tracking branch exists (in the case of ~/Desktop/fallstudie), git doesn't know which branch of origin it must take, and fails.\nTo fix this, you can make the branch track origin/master with:\ngit branch --set-upstream-to=origin/master \n\nOr, if master isn't the currently checked-out branch:\ngit branch --set-upstream-to=origin/master master"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-column"
},
{
"role": "assistant",
"content": "Display data in columns"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-format-patch - Prepare patches for e-mail submission -k --keep-subject"
},
{
"role": "assistant",
"content": "Do not strip/add [PATCH] from the first line of the\ncommit log message."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Convenient way to cache Node.js dependencies in GitLab CI/CD\n\nI'm using npm to install Node.js dependencies in my project. I want to cache Node.js packages (node_modules) globally to speed up jobs in pipelines when deploying to Heroku. An example from the official docs of GitLab:\ncache:\n key: ${CI_COMMIT_REF_SLUG}\n paths:\n - .npm/\n\nbefore_script:\n - npm ci --cache .npm --prefer-offline\n\nAnd here is another example in GitLab:\ncache:\n paths:\n - node_modules/\n\nFound some articles (Deploy Node.js App with GitLab CI/CD, Continuous Integration with Node.js, Heroku and GitLab CI/CD -Part 2) that used the second configuration above. I did give it a shot and I was able to deploy my app to Heroku with these settings successfully. But I'm not sure caching mechanism is working properly.\nWhat is the difference between these configurations? Which one is the most convenient way to cache Node.js packages?\nMy current setup for gitlab-ci.yml file:\nimage: node:latest\n\ncache:\n paths:\n - node_modules/\n\nstages:\n - build\n - deploy\n\nbuild:\n stage: build\n script:\n - npm i\n - npm i -g gulp-cli\n - gulp build\n\ndeploy:\n image: ruby:latest\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=$HEROKU_APP_NAME --api-key=$HEROKU_API_KEY\n only:\n - master\n\nNot sure if I'm doing it the right way."
},
{
"role": "assistant",
"content": "It depends if you want to use npm install, aka npm i, or if you want to use npm ci.\nnpm install will look first for an existent node_modules folder and will re-use it. If not, will fetch the dependencies. Check the full algorithm.\nnpm ci instead, removes an existing node_modules folder to perform a clean install of the dependencies. From the docs:\n\nIn short, the main differences between using npm install and npm ci are:\n\nThe project must have an existing package-lock.json or npm-shrinkwrap.json.\nIf dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.\nnpm ci can only install entire projects at a time: individual dependencies cannot be added with this command.\nIf a node_modules is already present, it will be automatically removed before npm ci begins its install.\nIt will never write to package.json or any of the package-locks: installs are essentially frozen.\n\n\nSome tests having ~/.npm and node_modules populated:\n$ npm i --prefer-offline\n#...\nupdated 2 packages in 17.472s\n\n$ rm -rf ~/.npm/ # removes global npm cache\n$ npm i --prefer-offline\n#...\nup to date in 16.271s # removing npm cache does not affects to npm i\n\n$ rm -rf node_modules/\n$ npm i --prefer-offline\n#...\nadded 2525 packages from 1197 contributors in 55.388s # removing node_modules affetcs to npm i\n\n$ npm ci --prefer-offline\n#...\nupdated 2 packages in 17.201s\n\n$ rm -rf ~/.npm/ # removes global npm cache\n$ npm ci --prefer-offline\n#...\nadded 2532 packages in 48.362s # removing npm cache affects to npm ci\n\n$ rm -rf node_modules/\n$ npm ci --prefer-offline\n#...\nadded 2532 packages in 18.695s # removing node_modules does not affetcs to npm ci\n\nSo ending up, npm ci has CI oriented features which can be interesting to use with but if there are no benefits for you just cache node_modules and use npm install instead."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab where is config.toml\n\nIm working on adding code quality to gitlab.\none of the step requires making changes to config.toml.\nI have .gitlab-ci.yml at root level of project repository.and pipeline picks up this file.\nwhere do i define config.toml ? at root level or i need to create a new folder like\n/etc/gitlab-runner/config.toml"
},
{
"role": "assistant",
"content": "The config.toml file is what configures a runner. You wouldn't have one unless you're running your own gitlab-runners, in which case it would be in /etc/gitlab-runner/config.toml on the host running the runner. More information on Gitlab Runner and running it yourself is available here."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs log.abbrevCommit"
},
{
"role": "assistant",
"content": "If true, makes git-log , git-show , and git-whatchanged assume --abbrev-commit . You may\noverride this option with --no-abbrev-commit ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What I can do to resolve \"1 commit behind master\"?\nAfter pushing I've been seeing this message at remote repository:\n\n1 commit behind master.\nThis merge has conflicts that must be resolved before it can be committed.\nTo manually merge these changes into TA20footerLast run the following commands:\ngit checkout 7c891f50c557\nNote: This will create a detached head!\ngit merge remotes/origin/master"
},
{
"role": "assistant",
"content": "Before you begin, if you are uncomfortable with a command line, you can do all the following steps using SourceTree, GitExtensions, GitHub Desktop, or your favorite tool.\nTo solve the issue, you might have two scenarios:\n\n1. Fix only remote repository branch which is behind commit\nExample: Both branches are on the remote side\nahead === Master branch\nbehind === Develop branch\nSolution:\n\nClone the repository to the local workspace: this will give you the Master branch, which is ahead with commit\ngit clone repositoryUrl\n\n\nCreate a branch with Develop name and checkout to that branch locally\ngit checkout -b DevelopBranchName // this command creates and checkout the branch\n\n\nPull from the remote Develop branch. Conflict might occur. if so, fix the\nconflict and commit the changes.\n git pull origin DevelopBranchName\n\n\nMerge the local Develop branch with the remote Develop branch\n git merge origin develop\n\n\nPush the merged branch to the remote Develop branch\n git push origin develop\n\n\n\n\n2. Local Master branch is behind the remote Master branch\nThis means every locally created branch is behind.\nBefore preceding, you have to commit or stash all the changes you made on the branch behind commits.\nSolution:\n\nCheckout your local Master branch\ngit checkout master\n\n\nPull from remote Master branch\ngit pull origin master\n\n\n\nNow your local Master is in sync with the remote branch. As a result of the above command, other local branches branched from the previous local Master branch are not in sync. To fix that:\n\nCheckout the branch that is behind your local Master branch\ngit checkout BranchNameBehindCommit\n\n\nMerge with the local Master branch\ngit merge master // Now your branch is in sync with the local Master branch\n\n\n\nIf this branch is on the remote repository, you have to push your changes.\n git push origin branchBehindCommit"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Can you issue pull requests from the command line on GitHub?\n\nIt seems like you have to interact with github.com to initiate a pull request. Is this so?"
},
{
"role": "assistant",
"content": "UPDATE: The hub command is now an official github project and also supports creating pull requests\nORIGINAL:\nSeems like a particularly useful thing to add to the hub command: http://github.com/defunkt/hub or the github gem: http://github.com/defunkt/github-gem\nI suggest filing an issue with those projects asking for it. The github guys are pretty responsive."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Remove sensitive files and their commits from Git history\n\nI would like to put a Git project on GitHub but it contains certain files with sensitive data (usernames and passwords, like /config/deploy.rb for capistrano).\nI know I can add these filenames to .gitignore, but this would not remove their history within Git.\nI also don't want to start over again by deleting the /.git directory.\nIs there a way to remove all traces of a particular file in your Git history?"
},
{
"role": "assistant",
"content": "For all practical purposes, the first thing you should be worried about is CHANGING YOUR PASSWORDS! It's not clear from your question whether your git repository is entirely local or whether you have a remote repository elsewhere yet; if it is remote and not secured from others you have a problem. If anyone has cloned that repository before you fix this, they'll have a copy of your passwords on their local machine, and there's no way you can force them to update to your \"fixed\" version with it gone from history. The only safe thing you can do is change your password to something else everywhere you've used it.\n\nWith that out of the way, here's how to fix it. GitHub answered exactly that question as an FAQ:\nNote for Windows users: use double quotes (\") instead of singles in this command\n\ngit filter-branch --index-filter \\\n'git update-index --remove PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA' <introduction-revision-sha1>..HEAD\ngit push --force --verbose --dry-run\ngit push --force\n\nUpdate 2019:\nThis is the current code from the FAQ:\n git filter-branch --force --index-filter \\\n \"git rm --cached --ignore-unmatch PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA\" \\\n --prune-empty --tag-name-filter cat -- --all\n git push --force --verbose --dry-run\n git push --force\n\nKeep in mind that once you've pushed this code to a remote repository like GitHub and others have cloned that remote repository, you're now in a situation where you're rewriting history. When others try pull down your latest changes after this, they'll get a message indicating that the changes can't be applied because it's not a fast-forward. \nTo fix this, they'll have to either delete their existing repository and re-clone it, or follow the instructions under \"RECOVERING FROM UPSTREAM REBASE\" in the git-rebase manpage.\nTip: Execute git rebase --interactive\n\nIn the future, if you accidentally commit some changes with sensitive information but you notice before pushing to a remote repository, there are some easier fixes. If you last commit is the one to add the sensitive information, you can simply remove the sensitive information, then run:\ngit commit -a --amend\n\nThat will amend the previous commit with any new changes you've made, including entire file removals done with a git rm. If the changes are further back in history but still not pushed to a remote repository, you can do an interactive rebase:\ngit rebase -i origin/master\n\nThat opens an editor with the commits you've made since your last common ancestor with the remote repository. Change \"pick\" to \"edit\" on any lines representing a commit with sensitive information, and save and quit. Git will walk through the changes, and leave you at a spot where you can:\n$EDITOR file-to-fix\ngit commit -a --amend\ngit rebase --continue\n\nFor each change with sensitive information. Eventually, you'll end up back on your branch, and you can safely push the new changes."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git push rejected \"non-fast-forward\"\nI am fairly new to git, yet currently using it to manage our code in a team environment. I had some rebasing issues, and I fixed them using:\ngit checkout --ours filename.txt\ngit add filename.txt\ngit rebase --continue\n\nNow I wish to push my changes, and so running the following command:\n$ git push origin feature/my_feature_branch\n\nGave me the following error:\nTo ssh://[email protected]:7999/repo/myproject.git\n ! [rejected] feature/my_feature_branch -> feature/my_feature_branch (non-fast-forward)\nerror: failed to push some refs to 'ssh://[email protected]:7999/repo/myproject.git'\nhint: Updates were rejected because the tip of your current branch is behind\nhint: its remote counterpart. Merge the remote changes (e.g. 'git pull')\nhint: before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details.\n\nWhat can I do to get rid of this error?\nNote: I am avoiding the use of --force option as much as possible."
},
{
"role": "assistant",
"content": "It looks, that someone pushed new commits between your last git fetch and git push. In this case you need to repeat your steps and rebase my_feature_branch one more time.\ngit fetch\ngit rebase feature/my_feature_branch\ngit push origin feature/my_feature_branch\n\nAfter the git fetch I recommend to examine situation with gitk --all."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git - Different Remote for each Branch\nI'm unsure of how to ask this properly but I'll try and do my best - I'm by no means a Git aficionado, I know how to use the basic commands but not advanced terminology/functionality.\nI have a private repository myrepo cloned from a private server git.mydomain.com. I'm familiar with the process of branching code on the same repository with git checkout -b mybranch - however I'd like to branch to GitHub rather than my private server, resulting in something like this:\nRepo Branch Remote Location (Purpose)\n------------------------------------------------------------\nmyrepo --> private --> git.mydomain.com (Incremental work)\n |\n +------> public --> github.com (Public releases)\n\nEssentially I'd like to be able to git checkout public and git merge private."
},
{
"role": "assistant",
"content": "You can set a different branch to push to a different server for individual branches by using these commands:\nAs of Git 1.8.0:\ngit branch --set-upstream-to origin/foo foo\n\nNote: If the last foo is left out, it will choose the current branch.\nAs of Git 1.7.0:\ngit branch --set-upstream foo origin/foo\n\nIn your case, you would use this by adding your two remotes (mydomain and github) and setting each branch to push to them individually. It might look something like this:\nMake sure you add the remotes if you haven't already:\ngit remote add github git://github.com/foo/myrepo.git\ngit remote add mydomain git://git.mydomain.com/foo/myrepo.git\n\nThen set the branches to push to the right places:\ngit branch --set-upstream-to mydomain/private private\ngit branch --set-upstream-to github/public public\n\nAfter this is all set up, you can push and pull just by using git push and git pull. This will push and pull to the github remote when you're on the public branch, and to your mydomain.com remote when you're on your private branch."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git on Bitbucket: Always asked for password, even after uploading my public SSH key\nI uploaded my ~/.ssh/id_rsa.pub to Bitbucket's SSH keys as explained, but Git still asks me for my password at every operation (such as git pull). Did I miss something?\nIt is a private repository (fork of another person's private repository) and I cloned it like this:\ngit clone [email protected]:Nicolas_Raoul/therepo.git\n\nHere is my local .git/config:\n[core]\n repositoryformatversion = 0\n filemode = true\n bare = false\n logallrefupdates = true\n[remote \"origin\"]\n fetch = +refs/heads/*:refs/remotes/origin/*\n url = https://[email protected]/Nicolas_Raoul/therepo.git\n[branch \"master\"]\n remote = origin\n merge = refs/heads/master\n\nIn the same environment with the same public key, Git on Github works fine.\n.ssh is rwx------, .ssh/id_rsa is -rw-------, .ssh/id_rsa.pub is -rw-r--r--"
},
{
"role": "assistant",
"content": "Are you sure you cloned it using the ssh url?\nThe url for origin says url = https://[email protected]/Nicolas_Raoul/therepo.git so if it is using https it will ask for password irrespective of your ssh keys.\nSo what you want to do is the following:\nopen your config file in your current repo ..\nvim .git/config\nand change the line with the url from\n[remote \"origin\"]\n fetch = +refs/heads/*:refs/remotes/origin/*\n url = https://[email protected]/Nicolas_Raoul/therepo.git\n\nto \n[remote \"origin\"]\n fetch = +refs/heads/*:refs/remotes/origin/*\n url = [email protected]:Nicolas_Raoul/therepo.git"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Why do I have to hit 'Q' at the end of 'git log'?\nConsider:\ngit log -n 20 --pretty=oneline\n\nI am telling Git that I need to see only the last 20 commits. I hate to hit Q to get rid of END. Is there a way out so that I don't have to hit Q?"
},
{
"role": "assistant",
"content": "Git is automatically paging the output for you, since logs tend to easily overflow a single terminal window size (you're in one of the rare exceptions - a oneline format and a small commit limit). If you don't want this, use:\ngit --no-pager log -n 20 --pretty=oneline\n\nNote that this does mean you'll get some ugly wrapping, because the pager was previously turning off wrapping for you (since you could use the cursor keys to scroll left-right)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to keep git from tracking all files that end with a \"~\"?\nI'm using Gedit, and each time I save a file, Gedit creates a copy of it, and the name of the copy always ends with a ~. The problem is, Git always tries to track these files, and I don't want that! Is there a way to still be able to use git add ., but add just those files that do not end with ~?"
},
{
"role": "assistant",
"content": "gitignore is the way to go. Just add *~ to .gitignore at the root of you repo."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to git cherrypick all changes introduced in specific branch\nBackground info: \nDue to restrictions in workflow with out existing systems, we need to set up a somewhat unorthodox git process. \n(patch) A-B---F\n | |\n(hotfix) C-D-E\n |\n(dev) 1-2-3-G\n\nOn the patch branch, there are some commits. The files here are similar but not identical to the ones on dev (sync scripts switch around the order of settings in many of the files, making them appear changed while they are functionally the same). \nA fix is needed on this branch so a hotfix branch is created and worked on. This branch is then merged back into patch, so far, so good.\nThis same fix needs to be deployed to the dev branch so it stays relatively in sync with patch, but trying to merge the hotfix branch leads to git trying to merge all the unrelated and 'unchanged' files from A and B as well, rather than only C,D and E.\nQuestion:\nIt seems that cherry-pick does what we want in terms of only getting changes from selected commits, but I would really like a way to cherry-pick all commits in a given branch at once, without having to look up the commit ids every time."
},
{
"role": "assistant",
"content": "It seems that cherry-pick does what we want in terms of only getting changes from selected commits, but I would really like a way to cherry-pick all commits in a given branch at once, without having to look up the commit ids every time.\n\n\nUsing cherry-pick\ngit cherry-pick allows you to pick any commits you made in any branch to any other branch. In your case, you can simply checkout the master branch and then cherry-pick all the commits from any branch that you wish (cherry-pick supports ranges so you can specify start and end commits instead of listing all the commits).\nThis way you can control the way your commits will appear in the desired branch.\nFor example:\ngit cherry-pick ebe6942..905e279\n\n\n# 1. Find the range of commits you wish to re-add to your branch.\n# 2. Use git cherry-pick to add them back to the branch,\n# noting the range is exclusive of the start and inclusive of the end \ngit cherry-pick start..end\n\n# 3. If you wish to include the start commit as well,\n# add ^ right after start like so:\ngit cherry-pick start^..end\n\n\nHow to find the first commit of the branch?\ngit log\n# Print out the latest commit (first one) of the given branch\ngit log --oneline | tail -1\n\nmerge-base\nUse the merge-base command to find where the branch was split from the original branch:\ngit merge-base A B"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Github not update `raw` after commit\n\nUpdated: Seem it has about 5 minutes to update raw. I will close my question at here.\nI have a problem with Github.\nI want to get the file as raw format.\nI add new commit and my file is updated.\nLook like this:\n\nI add JUST keyword in variable tech.\n\nWhen I click raw. It keeps the previous version.\nLook like this:\n\nHave any method to get raw version of the file was commit."
},
{
"role": "assistant",
"content": "GitHub serves \"raw\" pages with Cache-Control: max-age=300. That's specified in seconds, meaning the pages are intended to be cached for 5 minutes.\nYou can see this if you open the Developer Tools in your web browser of choice before clicking the \"Raw\" button on GitHub."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "giteveryday - A useful minimum set of commands for Everyday Git Run git-daemon to serve /pub/scm from xinetd."
},
{
"role": "assistant",
"content": "$ cat /etc/xinetd.d/git-daemon\n# default: off\n# description: The Git server offers access to Git repositories\nservice git\n{\n\tdisable = no\n\ttype = UNLISTED\n\tport = 9418\n\tsocket_type = stream\n\twait = no\n\tuser = nobody\n\tserver = /usr/bin/git-daemon\n\tserver_args = --inetd --export-all --base-path=/pub/scm\n\tlog_on_failure += USERID\n} Check your xinetd(8) documentation and setup, this is from a Fedora system.\nOthers might be different."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-bugreport - Collect information for user to file a bug report -o <path> --output-directory <path>"
},
{
"role": "assistant",
"content": "Place the resulting bug report file in <path> instead of the current\ndirectory."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc default , myers"
},
{
"role": "assistant",
"content": "The basic greedy diff algorithm. Currently, this is the default."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Gitlab: Is it possible to filter merge requests by multiple authors?\n\nWe have monorepo, my team responsible for 3 of 20 packages/folder of repository, but sometimes we need to touch others packages/folders.\nFor reviewing teammates changes every member should add “team_label” for ability to filter by this label or to keep opened several tabs with merge requests for each author/team member.\nPreferable could be filtering MRs something like this by one of the author:\nauthor: username1 OR author:username2 OR author:username3\nWe are using GitLab Enterprise Edition 12.6.2-ee\nupd:\ndiscussed in gitlab docs comments and there is no ability to filter merge requests even with advanced search\n\nAdvanced Search does currently not have the facets available that you use in the dedicated issue or MR search\n\nhttps://docs.gitlab.com/ee/user/search/index.html#comment-4776091890\nFeature proposal:\n\nhttps://gitlab.com/gitlab-org/gitlab/issues/7826"
},
{
"role": "assistant",
"content": "Unfortunately to date you can't search merge requests with an OR query - and although gitlab states that successive clauses should be ANDed together a quick test suggests that in fact an arbitrary single clause is applied.\nSee e.g. https://forum.gitlab.com/t/mr-filtering-by-multiple-authors/33864"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-blame - Show what revision and author last modified each line of a file blame.showEmail"
},
{
"role": "assistant",
"content": "Show the author email instead of author name in git-blame .\nThis option defaults to false."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What Git branching models work for you?\nOur company is currently using a simple trunk/release/hotfixes branching model and would like advice on what branching models work best for your company or development process.\n\nWorkflows / branching models\nBelow are the three main descriptions of this I have seen, but they are partially contradicting each other or don't go far enough to sort out the subsequent issues we've run into (as described below). Thus our team so far defaults to not so great solutions. Are you doing something better? \n\ngitworkflows(7) Manual Page \n(nvie) A successful Git branching model\n(reinh) A Git Workflow for Agile Teams\n\nMerging vs rebasing (tangled vs sequential history) \nShould one pull --rebase or wait with merging back to the mainline until your task is finished? Personally I lean towards merging since this preserves a visual illustration of on which base a task was started and finished, and I even prefer merge --no-ff for this purpose. It has other drawbacks however. Also many haven't realized the useful property of merging - that it isn't commutative (merging a topic branch into master does not mean merging master into the topic branch).\nI am looking for a natural workflow \nSometimes mistakes happen because our procedures don't capture a specific situation with simple rules. For example a fix needed for earlier releases should of course be based sufficiently downstream to be possible to merge upstream into all branches necessary (is the usage of these terms clear enough?). However it happens that a fix makes it into the master before the developer realizes it should have been placed further downstream, and if that is already pushed (even worse, merged or something based on it) then the option remaining is cherry-picking, with its associated perils. What simple rules like such do you use? Also in this is included the awkwardness of one topic branch necessarily excluding other topic branches (assuming they are branched from a common baseline). Developers don't want to finish a feature to start another one feeling like the code they just wrote is not there anymore\nHow to avoid creating merge conflicts (due to cherry-pick)? \nWhat seems like a sure way to create a merge conflict is to cherry-pick between branches, they can never be merged again? Would applying the same commit in revert (how to do this?) in either branch possibly solve this situation? This is one reason I do not dare to push for a largely merge-based workflow.\nHow to decompose into topical branches? \nWe realize that it would be awesome to assemble a finished integration from topic branches, but often work by our developers is not clearly defined (sometimes as simple as \"poking around\") and if some code has already gone into a \"misc\" topic, it can not be taken out of there again, according to the question above? How do you work with defining/approving/graduating/releasing your topic branches?\nProper procedures like code review and graduating would of course be lovely. \nBut we simply cannot keep things untangled enough to manage this - any suggestions?\nintegration branches, illustrations?\n\nBelow is a list of related questions:\n\nWhat are some good strategies to allow deployed applications to be hotfixable?\nWorkflow description for Git usage for in-house development\nGit workflow for corporate Linux kernel development\nHow do you maintain development code and production code? (thanks for this PDF!)\ngit releases management\nGit Cherry-pick vs Merge Workflow\nHow to cherry-pick multiple commits\nHow do you merge selective files with git-merge?\nHow to cherry pick a range of commits and merge into another branch\nReinH Git Workflow\ngit workflow for making modifications you’ll never push back to origin\nCherry-pick a merge\nProper Git workflow for combined OS and Private code?\nMaintaining Project with Git\nWhy cant Git merge file changes with a modified parent/master.\nGit branching / rebasing good practices\nWhen will \"git pull --rebase\" get me in to trouble?\nHow are DVCS used in large teams?\n\nAlso check out what Plastic SCM writes on task driven development, and if Plastic is not your choice, study nvie's branching model and his supporting scripts."
},
{
"role": "assistant",
"content": "The most troubling feature new developers to DVCS need to realize is about the publication process:\n\nyou can import (fetch/pull) whatever remote repo you need\nyou can publish (push) to any (bare) repo you want\n\nFrom that, you can respect a few rules to make your questions easier:\n\nonly rebase a branch if it hasn't been pushed (not pushed since the last rebase)\nonly push to a bare repo (mandatory since Git1.7)\nfollow Linus's advices on rebase and merges\n\nNow:\nWorkflows / branching models: \neach workflow is there to support a release management process, and that is tailored for each project.\nWhat I can add to the workflow you mention is: each developer should not create a feature branch, only a \"current dev\" branch, because the truth is: the developer often doesn't know what exactly his/her branch will produce: one feature, several (because it ended up being too complex a feature), none (because not ready in time for release), another feature (because the original one had \"morphed\"),...\nOnly an \"integrator\" should established official feature branches on a \"central\" repo, which can then be fetched by developers to rebase/merge the part of their work that fits that feature.\nMerging vs rebasing (tangled vs sequential history): \nI like my answer you mention (\"Workflow description for git usage for in-house development\")\nI am looking for a natural workflow: \nfor fixes, it can help associating each fix with a ticket from a bug tracking, which helps the developer remember where (i.e. on which branch, i.e. a dedicated branch \"for fixes\") he/she should commit such modifications.\nThen hooks can help protect a central repo against pushes from non-validated bug-fixes or from branches from which one shouldn't push. (no specific solution here, all this need to be adapted to your environment)\nHow to avoid creating merge conflicts (due to cherry-pick)?\nAs stated by Jakub Narębski in his answer, cherry-picking should be reserved for rare situations where it is required.\nIf your setup involves a lot of cherry-picking (i.e. \"it is not rare\"), then something is off.\n\nWould applying the same commit in revert (how to do this?) \n\ngit revert should take care of that, but that is not ideal.\n\nHow to decompose into topical branches?\n\nAs long as a branch as not yet been pushed everywhere, a developer should reorganize its history of commits (once he/she finally see the development takes a more definitive and stable shape) into:\n\nseveral branches if needed (one by clear identified feature)\na coherent set of commits within one branch (see Trimming Git Checkins)\n\nProper procedures like code review and graduating ?\nIntegration branches (in a dedicated integration) repo can help the developer to:\n\nrebase his/her development on top of that remote integration branch (pull --rebase)\nsolve locally\npush the development to that repo\ncheck with the integrator that doesn't result in a mess ;)"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-fsck"
},
{
"role": "assistant",
"content": "Verifies the connectivity and validity of the objects in the database"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-grep"
},
{
"role": "assistant",
"content": "Print lines matching a pattern"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Is it possible to have different Git configuration for different projects?\n.gitconfig is usually stored in the user.home directory.\nI use a different identity to work on projects for Company A and something else for Company B (primarily the name / email). How can I have two different Git configurations so that my check-ins don't go with the name / email?"
},
{
"role": "assistant",
"content": "As of git version 2.13, git supports conditional configuration includes. In this example we clone Company A's repos in ~/company_a directory, and Company B's repos in ~/company_b.\nAt the end of your .gitconfig file, you can put something like this:\n[includeIf \"gitdir:~/company_a/\"]\n path = .gitconfig-company_a\n[includeIf \"gitdir:~/company_b/\"]\n path = .gitconfig-company_b\n\nExample contents of .gitconfig-company_a (the [core] section can be omitted if the global ssh key can be used):\n[user]\nname = John Smith\nemail = [email protected]\n\n[core]\nsshCommand = ssh -i ~/.ssh/id_rsa_companya\n\nExample contents of .gitconfig-company_b:\n[user]\nname = John Smith\nemail = [email protected]\n\n[core]\nsshCommand = ssh -i ~/.ssh/id_rsa_companyb"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc diff.dirstat"
},
{
"role": "assistant",
"content": "A comma separated list of --dirstat parameters specifying the\ndefault behavior of the --dirstat option to git-diff and friends. The defaults can be overridden on the command line\n(using --dirstat=<param1,param2,...> ). The fallback defaults\n(when not changed by diff.dirstat ) are changes,noncumulative,3 .\nThe following parameters are available: changes Compute the dirstat numbers by counting the lines that have been\nremoved from the source, or added to the destination. This ignores\nthe amount of pure code movements within a file. In other words,\nrearranging lines in a file is not counted as much as other changes.\nThis is the default behavior when no parameter is given. lines Compute the dirstat numbers by doing the regular line-based diff\nanalysis, and summing the removed/added line counts. (For binary\nfiles, count 64-byte chunks instead, since binary files have no\nnatural concept of lines). This is a more expensive --dirstat behavior than the changes behavior, but it does count rearranged\nlines within a file as much as other changes. The resulting output\nis consistent with what you get from the other --*stat options. files Compute the dirstat numbers by counting the number of files changed.\nEach changed file counts equally in the dirstat analysis. This is\nthe computationally cheapest --dirstat behavior, since it does\nnot have to look at the file contents at all. cumulative Count changes in a child directory for the parent directory as well.\nNote that when using cumulative , the sum of the percentages\nreported may exceed 100%. The default (non-cumulative) behavior can\nbe specified with the noncumulative parameter. <limit> An integer parameter specifies a cut-off percent (3% by default).\nDirectories contributing less than this percentage of the changes\nare not shown in the output. Example: The following will count changed files, while ignoring\ndirectories with less than 10% of the total amount of changed files,\nand accumulating child directory counts in the parent directories: files,10,cumulative ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs %ce"
},
{
"role": "assistant",
"content": "committer email"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I code against one github repo on 2 computers?\n\nI have two computers from which I want to contribute to one github repo. How can I accomplish this?"
},
{
"role": "assistant",
"content": "To keep both repositories in sync you should to pull the latest changes to your machine whenever you start working on the code. \nTo do this you want to execute\ngit pull\n\n...which is usually set up to pull from the default remote (origin) to your current branch. Git might complain if this isn't the case, and so the longer version will work as well:\ngit pull origin {branch_name}\n\nNote: this is the same process that you would use if two or more people were working on the same repo. Which is essentially what is happening, instead of two different people working on the same repository, you have two different machines working on the same repository.\nIf you are starting out fresh on a new machine all you need to do is clone the repo to it first:\ngit clone {remote_url}\n\nYou get this url from your GitHub repo's home page. This command will make a complete working copy of the repo in a subdirectory."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-fmt-merge-msg"
},
{
"role": "assistant",
"content": "Produce a merge commit message"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Check if current directory is a Git repository\nI am writing a series of scripts for Git management in zsh.\nHow do I check if the current directory is a Git repository? (When I'm not in a Git repo, I don't want to execute a bunch of commands and get a bunch of fatal: Not a git repository responses)."
},
{
"role": "assistant",
"content": "You can use:\ngit rev-parse --is-inside-work-tree\n\nWhich will print 'true' to STDOUT if you are in a git repos working tree.\nNote that it still returns output to STDERR if you are outside of a git repo (and does not print 'false').\nTaken from this answer: https://stackoverflow.com/a/2044714/12983"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Jenkins linking to my local git repository\nI'm new to Jenkins and git too. I created a remote repository at github.com and made a local copy of it.\nThen I want to link it through Jenkins. I installed needed plugins for git integration, but I don't know what my local Repository URL is to set it when configuring the new project. Could someone help me where to find it?"
},
{
"role": "assistant",
"content": "In this case, the URL should start with the file protocol followed by the path to the repository. E.g., file:///home/rbkcbeqc/dev/git/gitsandbox."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Why git blame does not follow renames?\n$ pwd\n/data/mdi2/classes\n\n$ git blame -L22,+1 -- utils.js\n99b7a802 mdi2/utils.js (user 2015-03-26 21:54:57 +0200 22) #comment\n\n$ git blame -L22,+1 99b7a802^ -- utils.js\nfatal: no such path mdi2/classes/utils.js in 99b7a802^\n\nAs you have noticed, the file were in different directory in that commit\n$ git blame -L22,+1 99b7a802^ -- ../utils.js\nc5105267 (user 2007-04-10 08:00:20 +0000 22) #comment 2\n\nDespite on doc\nThe origin of lines is automatically followed across whole-file renames (currently there is no option to turn\n the rename-following off)\n\nblame does not follow renames. Why?\nUPDATE: Short answer\ngit blame follow renames but not for git blame COMMIT^ -- <filename>\nBut this is too hard to track file renames manually through bulk of renames and ton of history.\nI think, this behaviour must be fixed to silently follow renames for git blame COMMIT^ -- <filename>. Or, at least, --follow must be implemented, so I can: git blame --follow COMMIT^ -- <filename>\nUPDATE2: That is impossible. Read below.\nANSWER FROM MAILLIST by Junio C Hamano \n\ngit blame follow renames but not for git blame COMMIT^ -- <filename>\n\nSuppose you have file A and file B in your version v1.0.\nSix month down the road, the code was much refactored, and you do\nnot need the contents of these two files separately. You have\nremoved A and B and much of what they had is now in file C. That is\nthe current state.\ngit blame -C HEAD -- C\n\nmay follow the contents from both just fine, but if you were\nallowed to say\ngit blame v1.0 -- C\n\nwhat does it even mean? C did not exist v1.0 at all. Are you\nasking to follow the contents of A back then, or B? How did you\ntell you meant A and not B when you told it C in this command?\n\"git blame\" follows content movements, and never treats \"renames\" in\nany special way, as it is a stupid thing to do to think a rename is\nsomehow special ;-)\nThe way you tell what content to start digging from to the command\nfrom its command line is to give starting point commit (defaults to\nHEAD but you may give COMMIT^ as your example) and the path in that\nstarting point. As it does not make any sense to tell C to Git and\nthen magically make it guess you meant A in some cases and B in some\nother. If v1.0 did not have C, the only sensible thing to do is to\nexit instead of making a guess (and without telling the user how it\nguessed)."
},
{
"role": "assistant",
"content": "git blame does follow renames (as does git log if you give it --follow). The problem lies in the way it follows renames, which is a not-very-thorough hack: as it steps back one commit at a time (from each child to each parent), it makes a diff—the same kind of diff you can make manually with:\ngit diff -M SHA1^ SHA1\n\n—and checks to see if this diff detected a rename.1\nThat's all fine as far as it goes, but it means that for git blame to detect a rename, (a) git diff -M has to be able to detect it (fortunately that is the case here) and—here's what's causing you problems—it must step across the rename.\nFor instance, suppose the commit graph looks a bit like this:\nA <-- B <-- ... Q <-- R <-- S <-- T\n\nwhere each uppercase letter represents a commit. Suppose further that a file was renamed in commit R, so that in commits R through T it has name newname while in commits A through Q it has name oldname.\nIf you run git blame -- newname, the sequence starts at T, compares S and T, compares R and S, and compares Q and R. When it compares Q and R, git blame discovers the name-change, and starts looking for oldname in commits Q and earlier, so when it compares P and Q it compares files oldname and oldname in those two commits.\nIf, on the other hand, you run git blame R^ -- newname (or git blame Q -- newname) so that the sequence starts at commit Q, there is no file newname in that commit, and there is no rename when comparing P and Q, and git blame simply gives up.\nThe trick is that if you're starting from a commit in which the file had the previous name, you must give git the old name:\ngit blame R^ -- oldname\n\nand then it all works again.\n\n1In the git diff documentation, you will see that there is a -M option that controls how git diff detects renames. The blame code modifies this a bit (and in fact does two passes, one with -M turned off and a second with -M turned on) and uses its own (different) -M option for somewhat different purposes, but ultimately it's using this same code.\n\n[Edit to add reply to comment (didn't fit as a comment itself)]:\n\nIs any tool that can show me file renames like: git renames <filename> SHA date oldname->newname\n\nNot exactly, but git diff -M comes close, and may be close enough.\nI'm not sure what you mean by \"SHA date\" here, but git diff -M allows you to supply two SHA-1s and compares left-vs-right. Add --name-status to get just file names and dispositions. Hence git diff -M --name-status HEAD oldsha1 may report that to convert from HEAD to oldsha1, git believes you should Rename a file and will report the old name as the \"new\" name. For instance, in the git repository itself, there is a file currently named Documentation/giteveryday.txt that used to have a slightly different name:\n$ git diff -M --name-status HEAD 992cb206\nM .gitignore\nM .mailmap\n[...snip...]\nM Documentation/diff-options.txt\nR097 Documentation/giteveryday.txt Documentation/everyday.txt\nD Documentation/everyday.txto\n[...]\n\nIf that's the file you care about, you're good. The two problems here are:\n\nfinding an SHA1: where did 992cb206 come from? If you already have an SHA-1, that's easy; if not, git rev-list is the SHA1-finding tool; read its documentation;\nand the fact that following a series of renames through each commit one commit at a time, as git blame does, may produce quite different answers than comparing a much-later commit (HEAD) against a much-earlier commit (992cb206 or whatever). In this case, it comes out the same, but the \"similarity index\" here is 97 out of 100. If it were to have been modified much more in some of the intermediate steps, that similarity index might fall below 50% ... yet, if we were to compare a revision just a little after 992cb206 to 992cb206 (as git blame would), perhaps the similarity index between those two files might be higher.\n\nWhat's needed (and missing) is for git rev-list itself to implement --follow, so that all commands that use git rev-list internally—i.e., most commands that work on more than just one revision—can do the trick. Along the way, it would be nice if it worked in the other direction (currently --follow is newer-to-older only, i.e., works fine with git blame and works ok with git log as long you don't ask for oldest history first with --reverse)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options sendmail"
},
{
"role": "assistant",
"content": "Quoted aliases and quoted addresses are not supported: lines that\ncontain a \" symbol are ignored. Redirection to a file ( /path/name ) or pipe ( |command ) is not\nsupported. File inclusion ( :include: /path/name ) is not supported. Warnings are printed on the standard error output for any\nexplicitly unsupported constructs, and any other lines that are not\nrecognized by the parser."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options diff.autoRefreshIndex"
},
{
"role": "assistant",
"content": "When using git diff to compare with work tree\nfiles, do not consider stat-only changes as changed.\nInstead, silently run git update-index --refresh to\nupdate the cached stat information for paths whose\ncontents in the work tree match the contents in the\nindex. This option defaults to true. Note that this\naffects only git diff Porcelain, and not lower level diff commands such as git diff-files ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to use Visual Studio Code as default editor for git?\nWhen using git at the command line, I am wondering if it is possible to use Visual Studio Code as the default editor, i.e. when creating commit comments and looking at a diff of a file from the command line.\nI understand that it won't be possible to use it for doing merges (at least at the minute) but does anyone know if it is possible to use it for looking at diff's, and if so, what command line options would be required in the .gitconfig file to make this happen?\nUPDATE 1:\nI have tried an approach similar to what I have done for Notepad++ in the past, i.e.\n#!/bin/sh\n\n\"c:/Program Files (x86)/Notepad++/notepad++.exe\" -multiInst -notabbar -nosession -noPlugin \"$*\"\n\nAnd used:\n#!/bin/sh\n\n\"C:\\Users\\gep13\\AppData\\Local\\Code\\app-0.1.0\\Code.exe\" \"$*\"\n\nBut this results in an error message:\nC:\\temp\\testrepo [master +1 ~0 -0]> git commit\n[8660:0504/084217:ERROR:crash_reporter_win.cc(70)] Cannot initialize out-of-process crash handler\nAborting commit due to empty commit message.\nC:\\temp\\testrepo [master +1 ~0 -0]>\n\nCode opens up correctly, with the expected content, but it isn't waiting on the response, i.e. clicking save and closing the window to return to prompt.\nUPDATE 2:\nI have just heard back from one of the developers working on VSCode. Looks like this functionality currently isn't supported :-(\nhttps://twitter.com/IsidorN/status/595501573880553472\nIf you are interested in seeing this feature get added, you might want to think about adding your votes here:\nhttp://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7756482-support-git-configure-diff-and-merge-tools\nUPDATE 3:\nI have been reliably informed that this feature has been picked up by the VSCode team, so I am looking forward to a future release that will include it.\nUPDATE 4:\nThanks to @f-boucheros comment below, I have been able to get VS Code working as the default editor for commit comments, rebase, etc. I would still like to see if it is possible to use it as the diff tool as well.\nUPDATE 5:\nAs per the accepted answer for the question, this is now possible using the V1.0 release of code."
},
{
"role": "assistant",
"content": "In the most recent release (v1.0, released in March 2016), you are now able to use VS Code as the default git commit/diff tool. Quoted from the documentations:\n\n\nMake sure you can run code --help from the command line and you get\nhelp.\n\n\nif you do not see help, please follow these steps:\n\nMac: Select Shell Command: Install 'Code' command in path from the Command Palette.\nCommand Palette is what pops up when you press shift + ⌘ + P while inside VS\nCode. (shift + ctrl + P in Windows)\nWindows: Make sure you selected Add to PATH during the\ninstallation.\nLinux: Make sure you installed Code via our new .deb or\n.rpm packages.\n\n\n\n\nFrom the command line, run git config --global core.editor \"code --wait\"\n\nNow you can run git config --global -e and use VS Code as editor for configuring Git.\n\nAdd the following to enable support for using VS Code as diff tool:\n\n[diff]\n tool = default-difftool\n[difftool \"default-difftool\"]\n cmd = code --wait --diff $LOCAL $REMOTE\n\n\nThis leverages the new --diff option you can pass to VS Code to\ncompare two files side by side.\nTo summarize, here are some examples of where you can use Git with VS\nCode:\n\ngit rebase HEAD~3 -i allows you to interactively rebase using VS Code\ngit commit allows you to use VS Code for the commit message\ngit add -p followed by e for interactive add\ngit difftool <commit>^ <commit> allows you to use VS Code as diff editor for changes"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc -M[<n>] --find-renames[=<n>]"
},
{
"role": "assistant",
"content": "Detect renames.\nIf n is specified, it is a threshold on the similarity\nindex (i.e. amount of addition/deletions compared to the\nfile’s size). For example, -M90% means Git should consider a\ndelete/add pair to be a rename if more than 90% of the file\nhasn’t changed. Without a % sign, the number is to be read as\na fraction, with a decimal point before it. I.e., -M5 becomes\n0.5, and is thus the same as -M50% . Similarly, -M05 is\nthe same as -M5% . To limit detection to exact renames, use -M100% . The default similarity index is 50%."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs -b --ignore-space-change"
},
{
"role": "assistant",
"content": "Ignore changes in amount of whitespace. This ignores whitespace\nat line end, and considers all other sequences of one or\nmore whitespace characters to be equivalent."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to solve the \"remote: You are not allowed to upload code.\" error on GitLab CI/CD job?\n\nI am currently trying to use GitLab to run a CI/CD job that runs a Python file that makes changes to a particular repository and then commits and pushes those changes to master. I also have a role of Master in the repository. It appears that all git functions run fine except for the git push, which leads to fatal: You are not currently on a branch. and with using git push origin HEAD:master --force, that leads to fatal: unable to access 'https://gitlab-ci-token:xxx@xxx/project.git/': The requested URL returned error: 403. I've been looking over solutions online, one being this one, and another being unprotecting it, and couldn't quite find what I was looking for just yet. This is also a sub-project within the GitLab repository. \nRight now, this is pretty much what my .gitlab-ci.yml looks like.\nbefore_script:\n - apt-get update -y\n - apt-get install git -y\n - apt-get install python -y\n - apt-get python-pip -y\n\nmain:\n script:\n - git config --global user.email \"xxx@xxx\"\n - git config --global user.name \"xxx xxx\"\n - git config --global push.default simple\n - python main.py\n\nMy main.py file essentially has a function that creates a new file within an internal directory provided that it doesn't already exist. It has a looks similar to the following:\nimport os\nimport json\n\ndef createFile(strings):\n print \">>> Pushing to repo...\";\n if not os.path.exists('files'):\n os.system('mkdir files');\n for s in strings:\n title = (\"files/\"+str(s['title'])+\".json\").encode('utf-8').strip();\n with open(title, 'w') as filedata:\n json.dump(s, filedata, indent=4);\n os.system('git add files/');\n os.system('git commit -m \"Added a directory with a JSON file in it...\"');\n os.system('git push origin HEAD:master --force');\n\ncreateFile([{\"title\":\"A\"}, {\"title\":\"B\"}]);\n\nI'm not entirely sure why this keeps happening, but I have even tried to modify the repository settings to change from protected pull and push access, but when I hit Save, it doesn't actually save. Nonetheless, this is my overall output. I would really appreciate any guidance any can offer.\n Running with gitlab-runner 10.4.0 (00000000)\n on cicd-shared-gitlab-runner (00000000)\n Using Kubernetes namespace: cicd-shared-gitlab-runner\n Using Kubernetes executor with image ubuntu:16.04 ...\n Waiting for pod cicd-shared-gitlab-runner/runner-00000000-project-00000-concurrent-000000 to be running, status is Pending\n Waiting for pod cicd-shared-gitlab-runner/runner-00000000-project-00000-concurrent-000000 to be running, status is Pending\n Running on runner-00000000-project-00000-concurrent-000000 via cicd-shared-gitlab-runner-0000000000-00000...\n Cloning repository...\n Cloning into 'project'...\n Checking out 00000000 as master...\n Skipping Git submodules setup\n $ apt-get update -y >& /dev/null\n $ apt-get install git -y >& /dev/null\n $ apt-get install python -y >& /dev/null\n $ apt-get install python-pip -y >& /dev/null\n $ git config --global user.email \"xxx@xxx\" >& /dev/null\n $ git config --global user.name \"xxx xxx\" >& /dev/null\n $ git config --global push.default simple >& /dev/null\n $ python main.py\n [detached HEAD 0000000] Added a directory with a JSON file in it...\n 2 files changed, 76 insertions(+)\n create mode 100644 files/A.json\n create mode 100644 files/B.json\n remote: You are not allowed to upload code.\n fatal: unable to access 'https://gitlab-ci-token:xxx@xxx/project.git/': The requested URL returned error: 403\n HEAD detached from 000000\n Changes not staged for commit:\n modified: otherfiles/otherstuff.txt\n no changes added to commit\n remote: You are not allowed to upload code.\n fatal: unable to access 'https://gitlab-ci-token:xxx@xxx/project.git/': The requested URL returned error: 403\n >>> Pushing to repo...\n Job succeeded"
},
{
"role": "assistant",
"content": "Here is a resource from Gitlab that describes how to make commits to the repository within the CI pipeline: https://gitlab.com/guided-explorations/gitlab-ci-yml-tips-tricks-and-hacks/commit-to-repos-during-ci/commit-to-repos-during-ci\nTry configuring your gitlab-ci.yml file to push the changes rather than trying to do it from the python file."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-add - Add file contents to the index modified content"
},
{
"role": "assistant",
"content": "Modified content is represented by \"-\" lines (removing the old content)\nfollowed by \"+\" lines (adding the replacement content). You can\nprevent staging the modification by converting \"-\" lines to \" \", and\nremoving \"+\" lines. Beware that modifying only half of the pair is\nlikely to introduce confusing changes to the index."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-send-email - Send a collection of patches as emails --to=<address>,…"
},
{
"role": "assistant",
"content": "Specify the primary recipient of the emails generated. Generally, this\nwill be the upstream maintainer of the project involved. Default is the\nvalue of the sendemail.to configuration value; if that is unspecified,\nand --to-cmd is not specified, this will be prompted for. This option may be specified multiple times."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-shortlog - Summarize git log output --ignore-missing"
},
{
"role": "assistant",
"content": "Upon seeing an invalid object name in the input, pretend as if\nthe bad input was not given."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-hash-object - Compute object ID and optionally create an object from a file --stdin-paths"
},
{
"role": "assistant",
"content": "Read file names from the standard input, one per line, instead\nof from the command-line."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git add . vs git commit -a\nWhat's the difference between:\n\ngit add .\ngit commit -a\n\nShould I be doing both, or is that redundant?"
},
{
"role": "assistant",
"content": "git commit -a means almost[*] the same thing as git add -u && git commit.\nIt's not the same as git add . as this would add untracked files that aren't being ignored, git add -u only stages changes (including deletions) to already tracked files.\n[*] There's a subtle difference if you're not at the root directory of your repository. git add -u stages updates to files in the current directory and below, it's equivalent to git add -u . whereas git commit -a stages and commits changes to all tracked files."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-add - Add file contents to the index -u --update"
},
{
"role": "assistant",
"content": "Update the index just where it already has an entry matching <pathspec> . This removes as well as modifies index entries to\nmatch the working tree, but adds no new files. If no <pathspec> is given when -u option is used, all\ntracked files in the entire working tree are updated (old versions\nof Git used to limit the update to the current directory and its\nsubdirectories)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs -S<string>"
},
{
"role": "assistant",
"content": "Look for differences that change the number of occurrences of\nthe specified string (i.e. addition/deletion) in a file.\nIntended for the scripter’s use. It is useful when you’re looking for an exact block of code (like a\nstruct), and want to know the history of that block since it first\ncame into being: use the feature iteratively to feed the interesting\nblock in the preimage back into -S , and keep going until you get the\nvery first version of the block. Binary files are searched as well."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker GIT_NOGLOB_PATHSPECS"
},
{
"role": "assistant",
"content": "Setting this Boolean environment variable to true will cause Git to treat all\npathspecs as literal (aka \"literal\" magic)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I disable git-lfs?\nI have a repository on bitbucket that is using LFS. Since using it for some time, I've decided to move the repository back to a space under my control. The only reason I used LFS in the first place was to effectively double my repository size limit (as files in LFS go in a separate bucket) but now I'm moving it, I no longer need to do this.\nI need a way to trawl through the entire git history, removing all traces of the work git LFS does (so all files are committed 'normally'). Once this is done, I intend to force push to the new repository.\nI've done quite a bit of searching, and come across suggested solutions but I don't understand how to implement/run them because they are high-level.\nHow do I wave goodbye to git LFS?"
},
{
"role": "assistant",
"content": "Update current commit only\nIf you want to move off LFS, but are not so worried about fixing the entire git history, you can do the following;\ngit lfs uninstall\ntouch **/*\ngit commit -a\n\nThis will uninstall LFS support, touch every single file (so that git recognises that is has changed) then commit them all. If you like you could be more specific (ie, **/*.png for example). Note that using ** requires extended glob support enabled (shopt -s globstar on bash)\nUpdate entire history\nThis worked for me - but it throws lots of errors (I think I'm getting an error for every commit that a file hasn't been added to LFS in) and takes a long time (roughly 2-3 seconds per commit).\ngit lfs uninstall\ngit filter-branch -f --prune-empty --tree-filter '\n git lfs checkout\n git lfs ls-files | cut -d \" \" -f 3 | xargs touch\n git rm -f .gitattributes\n git lfs ls-files | cut -d \" \" -f 3 | git add\n' --tag-name-filter cat -- --all\n\nIt uninstalls git LFS support (theoretically preventing LFS from messing with the index) then for each commit it makes sure the LFS files are checked out properly, then touches them all (so git realises they have changed), removes the settings for LFS found in .gitattributes so that when cloning it doesn't keep trying to use LFS, then adds the real file to the index.\nAfter you do the above, you will need to do a force push. Naturally, that'll throw anyone else working on your repo into a detached head state - so doing this during a code freeze is wise. Afterwards, it's probably easiest to get everyone to do a fresh clone."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "GitHub API: Repositories Contributed To\n\nIs there a way to get access to the data in the “Repositories contributed to” module on GitHub profile pages via the GitHub API? Ideally the entire list, not just the top five, which are all you can get on the web apparently."
},
{
"role": "assistant",
"content": "With GraphQL API v4, you can now get these contributed repo using :\n{\n viewer {\n repositoriesContributedTo(first: 100, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {\n totalCount\n nodes {\n nameWithOwner\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n}\n\nTry it in the explorer\nIf you have more than 100 contributed repo (including yours), you will have to go through pagination specifying after: \"END_CURSOR_VALUE\" in repositoriesContributedTo for the next request."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Setting different config for different repositories [duplicate]\nThis question already has answers here:\n \n \n\n\n\n\nCan I specify multiple users for myself in .gitconfig?\n\n (25 answers)\n \n\nClosed 10 years ago.\n\n\n\nI was wondering how am I going to change the contents of the command git config --list? I am going to pull/fork a repository from GitHub. I am going to configure such repositories on both of my Windows, Linux and Mac workstations."
},
{
"role": "assistant",
"content": "If you want to set up configurations that are specific for a particular repository, you have two options, to configure it from the command line, or edit the repo's config file in an editor.\nOption 1: Configure via command line\nSimply use the command line, cd into the root of your Git repo, and run git config, without the --system and the --global flags, which are for configuring your machine and user Git settings, respectively:\ncd <your-repo>\ngit config <setting-name> <setting-value>\ngit config <setting-name>=<setting-value> # alternate syntax\n\nOption 2: Edit config file directly\nYour other option is to edit the repo config file directly. With a default Git clone, it's usually the .git/config file in your repo's root folder. Just open that file in an editor and starting adding your settings, or invoke an editor for it at the command line using git config --edit.\nResources\nYou can learn more about configuring Git at the official Linux Kernel Git documentation for git config. In particular, you may be interested in seeing an example Git config:\n# Core variables\n[core]\n ; Don't trust file modes\n filemode = false\n# Our diff algorithm\n[diff]\n external = /usr/local/bin/diff-wrapper\n renames = true\n[branch \"devel\"]\n remote = origin\n merge = refs/heads/devel\n# Proxy settings\n[core]\n gitProxy=\"ssh\" for \"kernel.org\"\n gitProxy=default-proxy ; for the rest\n[include]\n path = /path/to/foo.inc ; include by absolute path\n path = foo ; expand \"foo\" relative to the current file\n path = ~/foo ; expand \"foo\" in your $HOME directory\n\nEdit\nAddressing the original poster's question about how to change user.name and user.email per repository, here is how to do it via the command line. Switch to each repository, and run the following:\ngit config user.name \"<name>\"\ngit config user.email \"<email>\"\n\nSince you're not using the --system or the --global flags, the above commands will apply to whichever repo you have in your terminal working directory only."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs %aI"
},
{
"role": "assistant",
"content": "author date, strict ISO 8601 format"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to recover `.git/index` locally?\nI accidentally deleted .git/index, is there a way to recover it? It's permanently deleted. I haven't committed anything yet."
},
{
"role": "assistant",
"content": "To rebuild the index file, you can try these two commands:\ngit reset # re-scan the working directory\ngit add -u # update the index"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker"
},
{
"role": "assistant",
"content": "Terminology Please see gitglossary ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git search for string in a single file's history\nSo if I have a file called foo.rb and it is giving me an error for a missing method called bar, so I want to search the history of foo.rb for the string bar to see if it was ever defined in the past.\nI found this Search all of Git history for a string?\nBut this searches all files. I just want to search in one file."
},
{
"role": "assistant",
"content": "For this purpose you can use the -S option to git log:\ngit log -S'bar' -- foo.rb"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I make a releases, builds, and/or snapshots with BitBucket?\nI would like to be able to make releases and builds for my game.\nI know GitHub has releases, but I am using BitBucket instead. \nDoes anyone know how to make releases with BitBucket as like a checkpoint so I can just have the files documented for every update?"
},
{
"role": "assistant",
"content": "2022: BCLOUD-11404 shows this is still not implemented\n\n2015: As I mentioned before, BitBucket doesn't support the GitHub-like release feature. Its FAQ still mention:\n\nFor binary or executable storage, we recommend you look into file hosting services such as DropBox, rsync, rsnapshot, rdiff-backup, and so forth. Still not sure what to do? Review this post on stackoverflow for more ideas.\n\nFor a BitBucket repo, you still have a soft limit to 1GB and an hard limit to 2GB."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to fix: Domain does not resolve to the GitHub Pages server. Error in Github Pages for custom domain setup with Enforce HTTPS Enabled?\n\nSo I am trying to get a custom domain to work with my github pages user site. I have followed pretty much the standard procedure for doing this as follows: (recommended by github here too: https://help.github.com/articles/setting-up-an-apex-domain-and-www-subdomain/). Note I need both the apex domain (example.com) and the www subdomain (www.example.com) to resolve to my github pages user site at username.github.io (the website itself is a jekyll based blog and I have checked that it compiles successfully before I started this process)\n\nI added an A record to my DNS records at the registrar pointing to all of the four IP addresses provided by Github from the apex domain example.com:\n\n\n185.199.108.153\n185.199.109.153\n185.199.110.153\n185.199.111.153\n\n\nNext I went in and added a CNAME record for the www sub domain pointing to username.github.io\nAnd then I finally enabled the custom domain example.com under the settings tab of the repository (under Github Pages > Custom Domain), and also enabled the Enforce HTTPS option after it was enabled within about an hour.\n\nI have tried contacting my registrar and they said that everything in the DNS record seem fine and they get the following results:\nA records :\n example.com. 21460 IN A 185.199.111.153\n example.com. 21460 IN A 185.199.109.153\n example.com. 21460 IN A 185.199.110.153\n example.com. 21460 IN A 185.199.108.153\n\nCNAME :\nwww.example.com. 7199 IN CNAME username.github.io.\n\nAs expected.\nBut I still get the following error in github (under the settings tab of the repository):\n\"**Domain does not resolve to the GitHub Pages server. For more information, see https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/.**\"\nAnd when I try to access the site by typing either example.com or www.example.com, the browser redirects to https://example.com/ and I get the error (on Chrome):\nERR_CONNECTION_REFUSED\nNote that there is a warning on the documentation by github saying:\nWarning: If your domain has HTTPS enforcement enabled, GitHub Pages' servers will not automatically route redirects. You must configure www subdomain and root domain redirects with your domain registrar.\nI have no idea how to get around this. I suspect this is the possible cause of the issue. So a solution might be to circumvent this redirection, I just do not know how I would do this."
},
{
"role": "assistant",
"content": "For anyone stumbling across this. Actually I realized I have outlined the correct method to set this up with Github Pages. And this is in line with what is recommended by Github as of today and works perfectly well. Just make sure you wait for the DNS Propagation to take effect which in some cases might take up to 24hrs. And this is what the problem was in my case."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker gitformat-commit-graph"
},
{
"role": "assistant",
"content": "Git commit-graph format"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to change the name of a gist in github?\n\nIs there a way to change the name of a gist (github) ?, apparently it is ordering the files of the gist in alphabetical order, an naming the gist according to the file that appears first."
},
{
"role": "assistant",
"content": "Even better, you can add a file with a leading space in its name. It's virtually invisible and gives you more freedom when choosing the title and names for the files:"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.