messages listlengths 3 3 |
|---|
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git pull results in extraneous \"Merge branch\" messages in commit log\n\nI'm working with another developer on a project, and we're using Github as our remote repo. I'm on a Mac using git 1.7.7.3, he's on Windows using git 1.7.6.\nThis is what's happening\n\nOne of us (let's call him developer A, but it doesn't matter which one) pushes a set of commits to GitHub.\nThe other (developer B) makes some local commits.\nB does a git pull.\nB does a git push.\nLooking at the commit history log, I see Merge branch 'master' of github.com:foo/bar\n\nThe commit log gets littered with \"Merge branch\" messages over time, and also shows developer B as committing changes that developer A made. The only way we've found to prevent this issue has been to do a git pull --rebase at step 3, but I don't know what side effects rebasing will introduce. This is my first time working on a multi-developer git repo, so is this just normal behavior? Any thoughts on how to solve this issue?"
},
{
"role": "assistant",
"content": "The commit you are seeing is perfectly fine. A pull effectively runs git fetch and then git merge so a merge is usually happening when you run git pull.\nThe alternative to use rebasing instead of merging is possible, but usually you should avoid it. Rebasing allows you to keep a linear history, but also removes any information about the branching that originally happened. It will also cause the history of the current branch being rewritten, recreating all commits that are not contained in the target branch (in your case, the remote). As the recreated commits are different commits, this can cause a lot of confusion when developing together with others, especially when people already checked out parts of those commits before they get rewritten (for example with feature branches). So as a rule of thumb, you should never rewrite any commit that was already pushed.\nThe commits you see are there to combine two (or more) branches. It is perfectly fine to have a commit that does nothing else then merging multiple branches. In fact it makes it very clear when you have a merge commit that combines branches when looking at the history. In comparison to rebasing, merging also allows you to effectively see the original history as it was developed, including the actual branches that coexisted.\nSo, long story short: Yes, having merge commits is perfectly fine and you should not worry about them."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Deleting SSH keys terminal\n\nHow would I delete github_rsa.pub and id_rsa.pub SSH certificates from my mac computer using mac terminal?"
},
{
"role": "assistant",
"content": "Depending on where they are located:\nrm github_rsa.pub\n\nand\nrm id_rsa.pub\n\nIf they are in the default location then you can do\nrm ~/.ssh/github_rsa.pub\n\nand\nrm ~/.ssh/id_rsa.pub\n\nHowever this is likely answered already elsewhere."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker -h --help"
},
{
"role": "assistant",
"content": "Prints the synopsis and a list of the most commonly used\ncommands. If the option --all or -a is given then all\navailable commands are printed. If a Git command is named this\noption will bring up the manual page for that command. Other options are available to control how the manual page is\ndisplayed. See git-help for more information,\nbecause git --help ... is converted internally into git\nhelp ... ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-cat-file - Provide contents or details of repository objects contents <object>"
},
{
"role": "assistant",
"content": "Print object contents for object reference <object> . This corresponds to\nthe output of --batch ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc none"
},
{
"role": "assistant",
"content": "Disable word diff again."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitfaq - Frequently asked questions about using Git I asked Git to ignore various files, yet they are still tracked"
},
{
"role": "assistant",
"content": "A gitignore file ensures that certain file(s) which are not\ntracked by Git remain untracked. However, sometimes particular\nfile(s) may have been tracked before adding them into the .gitignore , hence they still remain tracked. To untrack and\nignore files/patterns, use git rm --cached <file/pattern> and add a pattern to .gitignore that matches the <file>.\nSee gitignore for details."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index ignore-all-space"
},
{
"role": "assistant",
"content": "Ignore whitespace when comparing lines. This ignores differences\neven if one line has whitespace where the other line has none."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": ".gitignore is not ignoring directories\n\nWhat I did:\nI think there were some weird configurations from the github gui that caused this issue and prevented me from being able to easily use git from command line or even git-bash.\nI ended up just uninstalling github and git then reinstalling just git for windows. I now have everything running off the command line(except ssh which I run from git-bash). Much easier and more reliable that the github gui.\nThanks to mu 無 for taking the time to try to figure this out. I didn't end up using his answer, but if I hadn't needed to do a reinstall of git it would have been what I needed to do.\n\nI am using the github gui on my local machine. I just noticed that a commit I was about to make was going to update all of my recently update node modules. I set up my .gitignore to ignore the entire node_modules/ directory.\nI'm not sure what to do about this. All the file types I included in .gitignore were ignored. It's just the directories that it seems to ignore.\nHere is my .gitignore file:\n#################\n## Sublime Text\n#################\n\n*.sublime-project\n*.sublime-workspace\n\n#################\n## Images\n#################\n\n*.jpg\n*.jpeg\n*.png\n*.gif\n*.psd\n*.ai\n\n#################\n## Windows detritus\n#################\n\n# Windows image file caches\nThumbs.db\nehthumbs.db\n\n# Folder config file\nDesktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Mac crap\n.DS_Store\n\n#################\n## Directories\n#################\n\ndev/\ncms/core/config/\nnode_modules/"
},
{
"role": "assistant",
"content": "Since the node_modules directory is already tracked as part of the repository, the .gitignore rule will not apply to it.\nYou need to untrack the directory from git using\ngit rm -r --cached node_modules\ngit commit -m \"removing node_modules\"\n\nYou can run the above 2 in git-bash.\nAfter this, the .gitignore rule will ignore the directory away.\nNote that this will remove the directory node_modules from your other repos once you pull the changes in. Only the original repo where you made that commit will still have the node_modules folder there."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git bash Error: Could not fork child process: There are no available terminals (-1)\nI have had up to 8 git bash terminals running at the same time before. \nCurrently I have only 2 up.\nI have not seen this error before and I am not understanding what is causing it.\nAny help would be appreciated!\nPicture attached:"
},
{
"role": "assistant",
"content": "Found a similar issue and solution in google groups\n\nI opened a windows command prompt and ran the command\n$ tasklist\n\nIt looks as though the ssh connections I had made in my git bash shells weren't being closed when those windows were closed and were hanging the available git bash shell windows.\nThis may be a dangerous solution but from the windows command prompt I ran\n$ taskkill /F /IM ssh.exe \n\nEverything appears to be working again after this. It may not have directly been an issue of orphan processes, but this worked for at least for me.\n\nAdditional note: you can also kill other processes, for example like:\n$ taskkill /F /IM vim.exe"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-update-ref"
},
{
"role": "assistant",
"content": "Update the object name stored in a ref safely"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc diff.<driver>.binary"
},
{
"role": "assistant",
"content": "Set this option to true to make the diff driver treat files as\nbinary. See gitattributes for details."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs --glob=<glob-pattern>"
},
{
"role": "assistant",
"content": "Pretend as if all the refs matching shell glob <glob-pattern> are listed on the command line as <commit> . Leading refs/ ,\nis automatically prepended if missing. If pattern lacks ? , * ,\nor [ , /* at the end is implied."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-filter-branch - Rewrite branches"
},
{
"role": "assistant",
"content": "NAME git-filter-branch - Rewrite branches"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-range-diff - Compare two commit ranges (e.g. two versions of a branch) <rev1>…<rev2>"
},
{
"role": "assistant",
"content": "Equivalent to passing <rev2>..<rev1> and <rev1>..<rev2> ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-svn - Bidirectional operation between a Subversion repository and Git -v --verbose"
},
{
"role": "assistant",
"content": "it’s not completely compatible with the --verbose\noutput in svn log, but reasonably close."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to git rebase a branch with the onto command?\nI have noticed that the two blocks of following git commands have different behaviours and I don't understand why.\nI have an A and a B branches that diverge with one commit\n---COMMIT--- (A)\n\\\n --- (B)\n\nI want to rebase B branch on the lastest A (and have the commit on the B branch)\n---COMMIT--- (A)\n \\\n --- (B)\n\nNo problem if I do:\ncheckout B\nrebase A\n\nBut if I do:\ncheckout B\nrebase --onto B A\n\nIt doesn't work at all, nothing happens. I don't understand why the two behaviours are different.\nPhpStorm GIT client uses the second syntax, and so seems to be completely broken, that's why I ask for this syntax issue."
},
{
"role": "assistant",
"content": "tl;dr\nThe correct syntax to rebase B on top of A using git rebase --onto in your case is:\ngit checkout B\ngit rebase --onto A B^\n\nor rebase B on top of A starting from the commit that is the parent of B referenced with B^ or B~1.\nIf you're interested in the difference between git rebase <branch> and git rebase --onto <branch> read on.\nThe Quick: git rebase\ngit rebase <branch> is going to rebase the branch you currently have checked out, referenced by HEAD, on top of the latest commit that is reachable from <branch> but not from HEAD.\nThis is the most common case of rebasing and arguably the one that requires less planning up front.\n Before After\n A---B---C---F---G (branch) A---B---C---F---G (branch)\n \\ \\\n D---E (HEAD) D---E (HEAD)\n\nIn this example, F and G are commits that are reachable from branch but not from HEAD. Saying git rebase branch will take D, that is the first commit after the branching point, and rebase it (i.e. change its parent) on top of the latest commit reachable from branch but not from HEAD, that is G.\nThe Precise: git rebase --onto with 2 arguments\ngit rebase --onto allows you to rebase starting from a specific commit. It grants you exact control over what is being rebased and where. This is for scenarios where you need to be precise.\nFor example, let's imagine that we need to rebase HEAD precisely on top of F starting from E. We're only interested in bringing F into our working branch while, at the same time, we don't want to keep D because it contains some incompatible changes.\n Before After\n A---B---C---F---G (branch) A---B---C---F---G (branch)\n \\ \\\n D---E---H---I (HEAD) E---H---I (HEAD)\n\nIn this case, we would say git rebase --onto F D. This means:\n\nRebase the commit reachable from HEAD whose parent is D on top of F.\n\nIn other words, change the parent of E from D to F. The syntax of git rebase --onto is then git rebase --onto <newparent> <oldparent>.\nAnother scenario where this comes in handy is when you want to quickly remove some commits from the current branch without having to do an interactive rebase:\n Before After\n A---B---C---E---F (HEAD) A---B---F (HEAD)\n\nIn this example, in order to remove C and E from the sequence you would say git rebase --onto B E, or rebase HEAD on top of B where the old parent was E.\nThe Surgeon: git rebase --onto with 3 arguments\ngit rebase --onto can go one step further in terms of precision. In fact, it allows you to rebase an arbitrary range of commits on top of another one.\nHere's an example:\n Before After\n A---B---C---F---G (branch) A---B---C---F---G (branch)\n \\ \\\n D---E---H---I (HEAD) E---H (HEAD)\n\nIn this case, we want to rebase the exact range E---H on top of F, ignoring where HEAD is currently pointing to. We can do that by saying git rebase --onto F D H, which means:\n\nRebase the range of commits whose parent is D up to and including H on top of F.\n\nThe syntax of git rebase --onto with a range of commits then becomes git rebase --onto <newparent> <oldparent> <until>. The trick here is remembering that the commit referenced by <until> is included in the range and will become the new HEAD after the rebase is complete."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to change past commit to include a missed file?\nI have committed a change and forgot to add a file to the change set. After other commits, I realized the file is now missing from a HEAD^4 commit.\nHow do I rewrite a previous commit to include the missing file?"
},
{
"role": "assistant",
"content": "I realize people can google and come here to find a simpler answer: What if it was just the last commit?\n (OP's question is for fixing the 4th commit back in history)\nIn the case you commit and realize you forgot to add some file immediately, just do:\n# edited file-that-i-remember.txt\ngit add file-that-i-remember.txt\ngit commit\n\n# realize you forgot a file\ngit add file-that-i-forgot.txt\ngit commit --amend --no-edit\n\nWhere --no-edit will keep the same commit message.\nEasy peasy!"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fsck - Verifies the connectivity and validity of the objects in the database badTimezone"
},
{
"role": "assistant",
"content": "(ERROR) Found an invalid time zone in an author/committer line."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "fatal: in unpopulated submodule\nI am quite new to github and I am trying to find a solution to a current problem that I am having. I will go through my process step by step:\nFirst I created a new folder named [project name]\nNext I used these commands:\n cd [project name]\n git clone [remote project from github url]\n\nSo far I have created a folder and cloned a project that my group is working on in github.\nNext, I went inside that folder and created an angular project with\n ng new [angulartest]\n\nThis will create all the components of my angular test into the same folder that is the clone of the one from github.\nFinally, I pushed the new angular test on github with\n git add [angulartest]\n git commit\n git push\n\nWhat happens is that it only pushes the folder [angulartest] but none of its contents (even though there are contents in it). When I try to pull from its contents, I still just get an empty folder in return.\nWhen I try to enter that folder and add each element of the contents, using these steps:\n cd [angulartest]\n git add e2e, src, nodemodules, etc\n git commit\n git push\n\nIt gives me the following error (even when I try to add each element individually):\nfatal: in unpopulated submodule [angulartest]\nI was wondering if it was a problem with my git syntax, the angular project, or the way I tried to clone the project. That way, I know which direction I want to be headed when looking for a solution."
},
{
"role": "assistant",
"content": "It seems like, you may have removed the .git folder. In that case you can try \n git rm --cached angulartest -f"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-gc - Cleanup unnecessary files and optimize the local repository gc.autoDetach"
},
{
"role": "assistant",
"content": "Make git gc --auto return immediately and run in the background\nif the system supports it. Default is true."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to wrap long lines inside of markdown ``` code ``` in Github and Gitlab issues?\n\neg:\n```\nsome very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; some very long line; \n```\n\nwill force user to scroll in github/gitlab issues.\nIs there a way to soft-line wrap inside code block ?\nI've read the related questions but they seem different (eg jekyll etc).\nEDIT: manually editing code to limit to 80 columns is not a viable option (eg, when pasting from a compiler output/log etc; that's a lot of work and should not be necessary)\nEDIT: see also https://github.com/softvar/enhanced-github/issues/95"
},
{
"role": "assistant",
"content": "A quick workaround is to quote your codeblocks, e.g.\n\nthis line is very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long\n\nMake sure you keep the three backticks inline with the very long line. Like this:\n> ```this line is very long```"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --submodule[=<format>]"
},
{
"role": "assistant",
"content": "Specify how differences in submodules are shown. When specifying --submodule=short the short format is used. This format just\nshows the names of the commits at the beginning and end of the range.\nWhen --submodule or --submodule=log is specified, the log format is used. This format lists the commits in the range like git-submodule summary does. When --submodule=diff is specified, the diff format is used. This format shows an\ninline diff of the changes in the submodule contents between the\ncommit range. Defaults to diff.submodule or the short format\nif the config option is unset."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-show-ref - List references in a local repository --verify"
},
{
"role": "assistant",
"content": "Enable stricter reference checking by requiring an exact ref path.\nAside from returning an error code of 1, it will also print an error\nmessage if --quiet was not specified."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What are the differences between git remote prune, git prune, git fetch --prune, etc\nMy situation is this... someone working on the same repo has deleted a branch from his local & remote repo...\nMost people who have asked about this kind of problem on Stack Overflow, or other sites have the issue of branches still showing in their remote tracking branch list git branch -a at the bottom:\n* master\n develop\n feature_blah\n remotes/origin/master\n remotes/origin/develop\n remotes/origin/feature_blah\n remotes/origin/random_branch_I_want_deleted\n\nHowever, in MY situation the branch that shouldn't be there, is local:\n* master\n develop\n feature_blah\n random_branch_I_want_deleted\n remotes/origin/master\n remotes/origin/develop\n remotes/origin/feature_blah\n\nWhen I do any of the following, it doesn't get removed locally:\n$ git prune\n\nI also tried:\n$ git remote prune origin\n$ git fetch --prune\n\nMore useful info: When I check git remote show origin this is how it looks:\n* remote origin\nFetch URL: utilities:homeconnections_ui.git\nPush URL: utilities:homeconnections_ui.git\nHEAD branch: master\nRemote branches:\n master tracked\n develop tracked\n feature_blah tracked\n other123 tracked\n other444 tracked\n other999 tracked\nLocal branches configured for 'git pull':\n develop merges with remote develop\n feature_blah merges with remote other999\n master merges with remote master\n random_branch_I_want_deleted merges with remote random_branch_I_want_deleted\nLocal refs configured for 'git push':\n develop pushes to develop (local out of date)\n master pushes to master (up to date)\n feature_blah pushes to feature_blah(up to date)\n\nNotice that it's only in the section titled Local branches configured for 'git pull':\nWhy?"
},
{
"role": "assistant",
"content": "I don't blame you for getting frustrated about this. The best way to look at is this. There are potentially three versions of every remote branch:\n\nThe actual branch on the remote repository\n (e.g., remote repo at https://example.com/repo.git, refs/heads/master)\nYour snapshot of that branch locally (stored under refs/remotes/...)\n (e.g., local repo, refs/remotes/origin/master)\nAnd a local branch that might be tracking the remote branch\n (e.g., local repo, refs/heads/master)\n\nLet's start with git prune. This removes objects that are no longer being referenced, it does not remove references. In your case, you have a local branch. That means there's a ref named random_branch_I_want_deleted that refers to some objects that represent the history of that branch. So, by definition, git prune will not remove random_branch_I_want_deleted. Really, git prune is a way to delete data that has accumulated in Git but is not being referenced by anything. In general, it doesn't affect your view of any branches.\ngit remote prune origin and git fetch --prune both operate on references under refs/remotes/... (I'll refer to these as remote references). It doesn't affect local branches. The git remote version is useful if you only want to remove remote references under a particular remote. Otherwise, the two do exactly the same thing. So, in short, git remote prune and git fetch --prune operate on number 2 above. For example, if you deleted a branch using the git web GUI and don't want it to show up in your local branch list anymore (git branch -r), then this is the command you should use.\nTo remove a local branch, you should use git branch -d (or -D if it's not merged anywhere). FWIW, there is no git command to automatically remove the local tracking branches if a remote branch disappears."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can one change the timestamp of an old commit in Git?\nThe answers to How to modify existing, unpushed commits? describe a way to amend previous commit messages that haven't yet been pushed upstream. The new messages inherit the timestamps of the original commits. This seems logical, but is there a way to also re-set the times?"
},
{
"role": "assistant",
"content": "You can do an interactive rebase and choose edit for the commit whose date you would like to alter. When the rebase process stops for amending the commit you type in for instance:\ngit commit --amend --date=\"Wed Feb 16 14:00 2011 +0100\" --no-edit\n\nP.S. --date=now will use the current time.\nAfterward, you continue your interactive rebase.\nTo change the commit date instead of the author date:\nGIT_COMMITTER_DATE=\"Wed Feb 16 14:00 2011 +0100\" git commit --amend --no-edit\n\nThe lines above set an environment variable GIT_COMMITTER_DATE which is used in amending commit.\nEverything is tested in Git Bash."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-version"
},
{
"role": "assistant",
"content": "Display version information about Git"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs off, none"
},
{
"role": "assistant",
"content": "Disable output of diffs for merge commits. Useful to override\nimplied value."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git rebase fails, 'Your local changes to the following files would be overwritten by merge'. No local changes?\nHere is my transcript from trying to merge my bugfix branch onto my master branch in preparation to push it upstream. There have been some upstream changes pulled into master since the bugfix branch was created, and it now refuses to rebase.\nThe files it throws errors on are not diffed when opened. no files have been added, removed or renamed. Nothing is ignored and nothing is untracked or staged or unstaged. I'm completely stumped as to why the rebase is failing.\nI'm on OS X 10.6.6 and git 1.7.4\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git rebase bug586-test master-test\nFirst, rewinding head to replay your work on top of it...\nApplying: - comiitting code related to api permissions\nUsing index info to reconstruct a base tree...\nFalling back to patching base and 3-way merge...\nerror: Your local changes to the following files would be overwritten by merge:\n inc/data.inc\n templates/apipermissions_tpl.inc\n templates/currencies_tpl.inc\nPlease, commit your changes or stash them before you can merge.\nAborting\nFailed to merge in the changes.\nPatch failed at 0001 - comiitting code related to api permissions\n\nWhen you have resolved this problem run \"git rebase --continue\".\nIf you would prefer to skip this patch, instead run \"git rebase --skip\".\nTo restore the original branch and stop rebasing run \"git rebase --abort\".\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git status\n# Not currently on any branch.\nnothing to commit (working directory clean)\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git rebase --abort\nHEAD is now at 5efccf1 - comiitting code related to api permissions\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git log -n10 --oneline\n5efccf1 - comiitting code related to api permissions\na8a5ee4 Style changes for IE\ncfca618 Style changes for IE\n8a69de6 Style changes for IE\n8946585 - comiitting code related to api permissions - fixed an html error in the currencies template\n5fba0a9 Merges the 1.11b branch bugfixes and changes into trunk\nef57049 Andrew Commiting on Blakes behalf on changes he made to transfers; Also an Indue GW balance fix; debitcarupload fix for LSN\n69e4313 Fixed an issue with Support From email\n9058fb6 Sets the svn property svn:eol-style to LF, to enforce unix style line endings\n240839e Fixes up a lot of the whitespace issues.\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git checkout bug586-test \nSwitched to branch 'bug586-test'\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git log -n10 --oneline \nb7b1f8a Resolves #586, Postback on deposit\n5fba0a9 Merges the 1.11b branch bugfixes and changes into trunk\nef57049 Andrew Commiting on Blakes behalf on changes he made to transfers; Also an Indue GW balance fix; debitcarupload fix for LSN\n69e4313 Fixed an issue with Support From email\n9058fb6 Sets the svn property svn:eol-style to LF, to enforce unix style line endings\n240839e Fixes up a lot of the whitespace issues.\ncf27b6f - bug that came up with transferring. The transfer page had a hidden field called to, which was taking precedence over cards and usercard which would throw the system out a bit\n7c21a81 Fixes #603, new add transaction form, journalled.\n01e6292 Removes a pile of resource forks\n880c5bc - bug that came up with transferring. The transfer page had a hidden field called to, which was taking precedence over cards and usercard which would throw the system out a bit\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git rebase master-test bug586-test\nFirst, rewinding head to replay your work on top of it...\nApplying: Resolves #586, Postback on deposit\nUsing index info to reconstruct a base tree...\n<stdin>:52: trailing whitespace.\n 'name' => 'Invoice Transfer Out', \n<stdin>:175: trailing whitespace.\n\nwarning: 2 lines add whitespace errors.\nFalling back to patching base and 3-way merge...\nerror: Your local changes to the following files would be overwritten by merge:\n templates/deposit_tpl.inc\nPlease, commit your changes or stash them before you can merge.\nAborting\nFailed to merge in the changes.\nPatch failed at 0001 Resolves #586, Postback on deposit\n\nWhen you have resolved this problem run \"git rebase --continue\".\nIf you would prefer to skip this patch, instead run \"git rebase --skip\".\nTo restore the original branch and stop rebasing run \"git rebase --abort\".\n\n\n\n.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-\n`--> git rebase --abort\nHEAD is now at b7b1f8a Resolves #586, Postback on deposit"
},
{
"role": "assistant",
"content": "This is the same answer as another one of my questions re git troubles.\nI'm on a mac, and this obscure config change seemed to fix all my woes regarding unstaged changes when there were none.\ngit config --global core.trustctime false\n\nI think it's to do with differences between windows file times, linux file times and mac file times. who knows, feel free to comment if you do.\nUpdate: This blog post explains what's going on, sort of."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to search through all Git and Mercurial commits in the repository for a certain string?\nI have a Git repository with few branches and dangling commits. I would like to search all such commits in repository for a specific string.\nI know how to get a log of all commits in history, but these don't include branches or dangling blobs, just HEAD's history. I want to get them all, to find a specific commit that got misplaced.\nI would also like to know how to do this in Mercurial, as I'm considering the switch."
},
{
"role": "assistant",
"content": "You can see dangling commits with git log -g.\n-g, --walk-reflogs\n Instead of walking the commit ancestry chain, walk reflog entries from\n the most recent one to older ones. \n\nSo you could do this to find a particular string in a commit message that is dangling:\ngit log -g --grep=search_for_this\n\nAlternatively, if you want to search the changes for a particular string, you could use the pickaxe search option, \"-S\":\ngit log -g -Ssearch_for_this\n# this also works but may be slower, it only shows text-added results\ngit grep search_for_this $(git log -g --pretty=format:%h)\n\nGit 1.7.4 will add the -G option, allowing you to pass -G<regexp> to find when a line containing <regexp> was moved, which -S cannot do. -S will only tell you when the total number of lines containing the string changed (i.e. adding/removing the string).\nFinally, you could use gitk to visualise the dangling commits with:\ngitk --all $(git log -g --pretty=format:%h)\n\nAnd then use its search features to look for the misplaced file. All these work assuming the missing commit has not \"expired\" and been garbage collected, which may happen if it is dangling for 30 days and you expire reflogs or run a command that expires them."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to move certain commits to be based on another branch in git?\nThe situation:\n\nmaster is at X\nquickfix1 is at X + 2 commits\n\nSuch that:\no-o-X (master HEAD)\n \\\n q1a--q1b (quickfix1 HEAD)\n\nThen I started working on quickfix2, but by accident took quickfix1 as the source branch to copy, not the master. Now quickfix2 is at X + 2 commits + 2 relevant commits.\no-o-X (master HEAD)\n \\\n q1a--q1b (quickfix1 HEAD)\n \\\n q2a--q2b (quickfix2 HEAD)\n\nNow I want to have a branch with quickfix2, but without the 2 commits that belong to quickfix1.\n q2a'--q2b' (quickfix2 HEAD)\n /\no-o-X (master HEAD)\n \\ \n q1a--q1b (quickfix1 HEAD)\n\nI tried to create a patch from a certain revision in quickfix2, but the patch doesn't preserve the commit history. Is there a way to save my commit history, but have a branch without changes in quickfix1?"
},
{
"role": "assistant",
"content": "This is a classic case of rebase --onto:\n # let's go to current master (X, where quickfix2 should begin)\n git checkout master\n\n # replay every commit *after* quickfix1 up to quickfix2 HEAD.\n git rebase --onto master quickfix1 quickfix2 \n\nSo you should go from\no-o-X (master HEAD)\n \\ \n q1a--q1b (quickfix1 HEAD)\n \\\n q2a--q2b (quickfix2 HEAD)\n\nto:\n q2a'--q2b' (new quickfix2 HEAD)\n /\no-o-X (master HEAD)\n \\ \n q1a--q1b (quickfix1 HEAD)\n\nThis is best done on a clean working tree.\nSee git config --global rebase.autostash true, especially after Git 2.10."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options worktreeAddOrphan"
},
{
"role": "assistant",
"content": "Shown when the user tries to create a worktree from an\ninvalid reference, to tell the user how to create a new unborn\nbranch instead."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc git diff HEAD"
},
{
"role": "assistant",
"content": "compares a (c)ommit and the (w)ork tree;"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git Status Takes a Long Time to Complete\nI'm using git to manage files in a local directory on a Windows machine - no network is involved here, I'm not pushing or pulling to/from another machine. My directory has maybe 100 files in it, all test files, pretty small. When I run git status, it regularly takes 20-30 seconds to complete. Is this normal? Is there anything I can do to speed it up, or a better way to see what the state of my repository is (changed files, untracked files, etc)? Other git commands seem to complete much faster."
},
{
"role": "assistant",
"content": "Have you tried git gc? This cleans cruft out of the git repo."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to create a .gitignore file\nI need to add some rules to my .gitignore file. However, I can't find it in my project folder. Isn't it created automatically by Xcode? If not, what command allows me to create one?"
},
{
"role": "assistant",
"content": "If you're using Windows, it will not let you create a file without a filename in Windows Explorer. It will give you the error \"You must type a file name\" if you try to rename a text file as .gitignore\n\nTo get around this, I used the following steps.\n\nCreate the text file gitignore.txt\nOpen it in a text editor and add your rules, then save and close\nHold Shift, right click the folder you're in, and then select Open command window here\nThen rename the file in the command line, with ren gitignore.txt .gitignore\n\nAlternatively, HenningCash suggests in the comments:\n\nYou can get around this Windows Explorer error by appending a dot to\nthe filename without an extension: .gitignore.. It will be automatically\nchanged to .gitignore."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Jenkinsfile: git rev-parse --abbrev-ref HEAD returns HEAD\nI am new to jenkins/devops; I am following this example. When I locally do (from the terminal):\ngit rev-parse --abbrev-ref HEAD\n\nI get the current branch's name. However from within Jenkinsfile, in the logs I am getting:\nHEAD\n\nBeen researching online for a while and couldn't find the reason so far. What are potential causes for this outcome?\nAdditional Details\nIn my jenkinsfile, i am trying to get the current git branch's name (the one that triggered the webhook) and then pipe it inside 'git branch' command, so code is as follows:\npipeline {\nagent {\n label 'ubuntu'\n}\nstages {\n stage('check') {\n steps {\n script {\n env.GIT_BRANCH_NAME=sh(returnStdout: true, script: \"git rev-parse --abbrev-ref HEAD\").trim()\n }\n\n sh 'echo BRANCH_NAME ${GIT_BRANCH_NAME}'\n git branch: GIT_BRANCH_NAME, credentialsId: '******', url: 'https://*****/*****/*****.git'\n }\n....\n}\n\nIn the line\nsh 'echo BRANCH_NAME ${GIT_BRANCH_NAME}'\n\nReturns HEAD\nI found a way around this using git name-rev --name-only HEAD and modified the script code to: \nscript {\n env.GIT_BRANCH_PATH=sh(returnStdout: true, script: \"git name-rev --name-only HEAD\").trim()\n env.GIT_BRANCH_NAME=GIT_BRANCH_PATH.split('remotes/origin/')[1]\n}\n\nNow I get the right branch name and the steps work, but I would rather have a less hacky way of doing things.\nWhat is the best method to achieve what I want to achieve using best practices?\nPS I am not using multi-branching pipeline and the requirements were to not use multi-branching."
},
{
"role": "assistant",
"content": "I am probably late in responding, but there is potentially a simpler way. Ensure that you select \"Check out to specific local branch\" under additional behaviors within your Git configuration. This will ensure that git checks out to the exact branch you are tracking, and your original command \"git rev-parse --abbrev-ref HEAD\" will work fine."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index ignore-space-at-eol"
},
{
"role": "assistant",
"content": "Ignore changes in whitespace at EOL."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-mergetool - Run merge conflict resolution tools to resolve merge conflicts --no-gui"
},
{
"role": "assistant",
"content": "This overrides a previous -g or --gui setting or mergetool.guiDefault configuration and reads the default merge\ntool from the configured merge.tool variable."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-tag"
},
{
"role": "assistant",
"content": "Create, list, delete or verify a tag object signed with GPG"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How can I \"login\" to git?\nI need to change who git thinks I am so I can push to a different repo ( both are mine. ).\nHere is a similar issue but I don't want to set any config variables.\nI just want to login once to my current username. I plan on deleting my other account.\nHere is the error when I attempt a git push origin master\n\nremote: Permission to current_user/fav-front.git denied to\n user_to_delete. fatal: unable to access\n 'https://github.com/current_user/repo.git/': The requested URL\n returned error: 403\n\nPlease note that the git config variables for user and email ( user.name and user.email ) are not related to the authentication that git push uses.\nThey are used for commits.\nTo reiterate, I want to login to git as current user."
},
{
"role": "assistant",
"content": "You don't login to Git.\nYou do login to a Git repository hosting server, which requests an authentication, but Git itself has no authentication nor authorization.\n(As an example of a Git repository hosting service offering login:\n\nGitHub: gh auth login\nGitLab: glab auth login)\n\nWhat Git does have is credential caching (check the output of git config credential helper)\nOn Mac: \"Updating credentials from the OSX Keychain\": you can check if your old user was stored there, and update it.\nIf you really want to disable the credential helper, you will be asked your credentials every time you push to a repository hosted on a server requesting authentication.\n\nRegarding AgilePro's answer:\n\nAgain, there is no way to ask git to log in, instead you have to make a bogus change and then try to push the change to get it to prompt you to log in.\n\nNot true.\nGit itself does not log you in, as mentioned in my answer above.\nA third-party CLI tool (like GitHub CLI gh) can connect to a repository hosting service (like github.com) and trigger the authentication.\nNo repository needed.\nWith GitHub: create first through the Web UI a Personal access tokens (classic), with minimum required scopes: repo, read:org, and gist.\nIts token prefix will be ghp_....\nThen authenticate yourself from the command-line, after installing gh, using gh auth login\ngh auth login\n\nYou can enter your GitHub user account name, and your token.\nThen, a gh auth status would give you:\nC:\\Users\\vonc\\git>gh auth status\ngithub.com\n ✓ Logged in to github.com as VonC (C:\\Users\\vonc\\AppData\\Roaming\\GitHub CLI\\hosts.yml)\n ✓ Git operations for github.com configured to use https protocol.\n ✓ Token: ghp_************************************\n ✓ Token scopes: admin:org, gist, repo, user, workflow\n\nYou are authenticated (to GitHub, not to \"Git\").\n\nYou can also register your token with the local credential manager:\ngit config --global credential.helper manager\nprintf \"protocol=https\\nhost=github.com\\nusername=<me>\\npassword=<my_token>\" |\\\n git-credential-manager store\n\nThis is purely for safekeeping, and does not authenticate you."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --ignore-space-at-eol"
},
{
"role": "assistant",
"content": "Ignore changes in whitespace at EOL."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git push to specific branch\nEven after reading this question: git-push-current-branch, I am still having difficulty figuring out how I should write my git push command. As mentioned in the question link, it's not clear from the documentation.\nI would like to use my 'real world' example. Following is what I see when I run the git status command on the top level of my branch:\n\nOn branch amd_qlp_tester\nYour branch is ahead of 'origin/amd_qlp_tester' by 5 commits.\netc...\n\nMy branch name is amd_qlp_tester but it was \"branched\" off from the main branch (if I have the terms wrong it's because of my SVN background). But then there is also the name origin/amd_qlp_testser\nSo how do I phrase my push command?\nIs it any of the following?\ngit push origin/amd_qlp_tester\ngit push origin amd_qlp_tester\ngit push amd_qlp_tester\ngit push origin\ngit push"
},
{
"role": "assistant",
"content": "If your Local branch and remote branch is the same name then you can just do it:\ngit push origin branchName\n\nWhen your local and remote branch name is different then you can do it:\ngit push origin localBranchName:remoteBranchName"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Where can I manage files uploaded to wiki of a Gitlab.com project?\n\nI have uploaded some files to my Gitlab repository on \"gitlab.com\" while creating wiki for my private project.\nNow my questions are:\n\nCan I see list of the uploaded files?\nIs there any way to remove some of them?\nWhy permission of uploaded file is public? Can I change it to private?\n\nCurrent version of gitlab is Enterprise Edition 8.9.4-ee."
},
{
"role": "assistant",
"content": "Attached files trough the wiki editor are uploaded to /uploads/. As of GitLab version 8.9.0 you are unable to manage these files (i.e. deleting them).\nIf you want to manage attached files yourself you can clone the wiki as repository. You can find the clone URL in Wiki -> Git Access. It should look something like this: git@<link to gitlab>:<group/user name>/<project name>.wiki.git. In the cloned repository you'll not find the /uploads/ directory, because it is located outside of the repository. Bun there you can put your images or other attachments, and link them within your wiki. The link to the image is relative to the repo root so if your image image.png is in the root folder you can link it with markdown like this.\nPermission wise these files will only be visible to Users which have at least Guest access to your project, even if they have a direct link."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-svn - Bidirectional operation between a Subversion repository and Git --use-svm-props"
},
{
"role": "assistant",
"content": "Set the useSvmProps option in the [svn-remote] config."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker"
},
{
"role": "assistant",
"content": "Configuration Mechanism Git uses a simple text format to store customizations that are per\nrepository and are per user. Such a configuration file may look\nlike this: #\n# A '#' or ';' character indicates a comment.\n#\n\n; core variables\n[core]\n\t; Don't trust file modes\n\tfilemode = false\n\n; user identity\n[user]\n\tname = \"Junio C Hamano\"\n\temail = \"gitster@pobox.com\" Various commands read from the configuration file and adjust\ntheir operation accordingly. See git-config for a\nlist and more details about the configuration mechanism."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker GIT_AUTHOR_NAME"
},
{
"role": "assistant",
"content": "The human-readable name used in the author identity when creating commit or\ntag objects, or when writing reflogs. Overrides the user.name and author.name configuration settings."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to fix a permission denied (publickey) error for a git submodule update in the Github Travis CI build?\nI cannot update the git submodule, with the error:\n$ git submodule init\nSubmodule 'build/html' ([email protected]:quadroid/clonejs.git) registered for path 'build/html'\n...\n$ git submodule update\nCloning into 'build/html'...\nWarning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.\nPermission denied (publickey).\nfatal: Could not read from remote repository.\n\nBut when I do the same tasks locally, everything is OK.\nHow do I fix this so that the Travis CI build passes and I can still click on the submodule in the repo to direct to it?"
},
{
"role": "assistant",
"content": "This can (thankfully) be easily solved by modifying the .gitmodules file on-the-fly on Travis, so that the SSH URL is replaced with the public URL, before initializing submodules. To accomplish this, add the following to .travis.yml:\n# Handle git submodules yourself\ngit:\n submodules: false\n# Use sed to replace the SSH URL with the public URL, then initialize submodules\nbefore_install:\n - sed -i 's/[email protected]:/https:\\/\\/github.com\\//' .gitmodules\n - git submodule update --init --recursive\n\nThanks to Michael Iedema for his gist from which I derived this solution.\nIf your submodules are private repositories, it should work to include credentials in the https URLs, I recommend making a GitHub access token with restricted permissions for this purpose:\n# Replace <user> and <token> with your GitHub username and access token respectively\n- sed -i 's/[email protected]:/https:\\/\\/<user>:<token>@github.com\\//' .gitmodules"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker git-bundle"
},
{
"role": "assistant",
"content": "Move objects and refs by archive"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc -X[<param1,param2,…>] --dirstat[=<param1,param2,…>]"
},
{
"role": "assistant",
"content": "Output the distribution of relative amount of changes for each\nsub-directory. The behavior of --dirstat can be customized by\npassing it a comma separated list of parameters.\nThe defaults are controlled by the diff.dirstat configuration\nvariable (see git-config ).\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: --dirstat=files,10,cumulative ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fetch - Download objects and refs from another repository"
},
{
"role": "assistant",
"content": "CONFIGURED REMOTE-TRACKING BRANCHES You often interact with the same remote repository by\nregularly and repeatedly fetching from it. In order to keep track\nof the progress of such a remote repository, git fetch allows you\nto configure remote.<repository>.fetch configuration variables. Typically such a variable may look like this: [remote \"origin\"]\n\tfetch = +refs/heads/*:refs/remotes/origin/* This configuration is used in two ways: When git fetch is run without specifying what branches\nand/or tags to fetch on the command line, e.g. git fetch origin or git fetch , remote.<repository>.fetch values are used as\nthe refspecs—they specify which refs to fetch and which local refs\nto update. The example above will fetch\nall branches that exist in the origin (i.e. any ref that matches\nthe left-hand side of the value, refs/heads/* ) and update the\ncorresponding remote-tracking branches in the refs/remotes/origin/* hierarchy. When git fetch is run with explicit branches and/or tags\nto fetch on the command line, e.g. git fetch origin master , the\n<refspec>s given on the command line determine what are to be\nfetched (e.g. master in the example,\nwhich is a short-hand for master: , which in turn means\n\"fetch the master branch but I do not explicitly say what\nremote-tracking branch to update with it from the command line\"),\nand the example command will\nfetch only the master branch. The remote.<repository>.fetch values determine which\nremote-tracking branch, if any, is updated. When used in this\nway, the remote.<repository>.fetch values do not have any\neffect in deciding what gets fetched (i.e. the values are not\nused as refspecs when the command-line lists refspecs); they are\nonly used to decide where the refs that are fetched are stored\nby acting as a mapping. The latter use of the remote.<repository>.fetch values can be\noverridden by giving the --refmap=<refspec> parameter(s) on the\ncommand line."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git export from github remote repository\nI'd like to export from github remote repository, not cloning it. Similar to svn export, I do not want to get .git folder with it. I can work around it by cloning and removing .git folder. I wonder if there is a cleaner way?\nI read it somewhere you can use git archive to achieve this.\nHowever I got the following errors..\n$ git archive --format=tar [email protected]:xxx/yyy.git master | tar -xf -\n\nInvalid command: 'git-upload-archive 'xxx/yyy.git''\nYou appear to be using ssh to clone a git:// URL.\nMake sure your core.gitProxy config option and the\nGIT_PROXY_COMMAND environment variable are NOT set.\nfatal: The remote end hung up unexpectedly\n\nAny help would be great. Thanks."
},
{
"role": "assistant",
"content": "Thanks to the Subversion support by GitHub, you can use svn export to get the project without any version control files:\nsvn export https://github.com/user/project/trunk\n\nNotice the URL format:\n\nThe base URL is https://github.com/\nUSERNAME/PROJECTNAME without .git\n/trunk appended at the end\n\nThis way you can get branches and subdirectories too.\nThis creates a directory with the exported files. It's not possible to create a tar/zip directly, you have to do in two steps (export + zip). This is a limitation of svn export itself.\nAs @Jon pointed out, this will create the export in a directory named trunk by default. You can specify a different name if you prefer:\nsvn export https://github.com/username/projectname/trunk projectname\n\nYou can use this technique to export any sub-directory of the project.\nFor example if you want only some/path, you can do:\nsvn export https://github.com/username/projectname/trunk/some/path local-dir-name\n\nYou can get paths from branches and tags too. The endpoint https://github.com/username/projectname behaves fully as a Subversion repository with a regular layout, so you will find branches in https://github.com/username/projectname/branches and tags in https://github.com/username/projectname/tags.\nBefore you export something large by mistake, it's good to check first the content of the path. You can do that using svn ls, for example:\nsvn ls https://github.com/username/projectname/\n\nNormally this should give you:\nbranches/\ntags/\ntrunk/\n\nYou could iteratively explore the repository this way."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index --quiet"
},
{
"role": "assistant",
"content": "Disable all output of the program. Implies --exit-code ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-shortlog - Summarize git log output --glob=<glob-pattern>"
},
{
"role": "assistant",
"content": "Pretend as if all the refs matching shell glob <glob-pattern> are listed on the command line as <commit> . Leading refs/ ,\nis automatically prepended if missing. If pattern lacks ? , * ,\nor [ , /* at the end is implied."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc <limit>"
},
{
"role": "assistant",
"content": "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."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I track the origin of a token in Gitlab?\n\nGiven a gitlab project/group access token, how do I find out the name of the token and from which group/project it came from?"
},
{
"role": "assistant",
"content": "You can use the user api such as:\nwget --header \"PRIVATE-TOKEN: <TOKEN>\" https://www.gitlab.com/api/v4/user\n\nThough this API you'll get the user that token is attached to. If the token is attached to a group or a project, you'll see the type and project/group ID in the results."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git: list all files added/modified on a day (or week/month...)\nGiven a period of time (e.g. a day, a week, a month), is it possible to list all files that were modified or added in this time?"
},
{
"role": "assistant",
"content": "I'd use diff to yield the file list directly, e.g:\ngit diff --name-only \"@{3 days ago}\" \"@{2 days ago}\"\n\nchangelog.txt\nnewfile.txt\n\nIn case you're curious which file got modified or added, use --name-status instead:\ngit diff --name-status \"@{3 days ago}\" \"@{2 days ago}\"\n\nM changelog.txt\nA newfile.txt"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff-index - Compare a tree to the working tree or index --no-color-moved"
},
{
"role": "assistant",
"content": "Turn off move detection. This can be used to override configuration\nsettings. It is the same as --color-moved=no ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-log - Show commit logs --show-notes[=<ref>] --[no-]standard-notes"
},
{
"role": "assistant",
"content": "These options are deprecated. Use the above --notes/--no-notes\noptions instead."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to fix this in git \"This branch is out-of-date with the base branch\"?\n\nI am working on a project and I made a PR to the project in github and now my PR says that\n\n\"This branch is out-of-date with the base branch , Merge the latest changes from master into this branch\"\n\nSo which git command should I use in order to make my branch parallel to the master branch?"
},
{
"role": "assistant",
"content": "If you created the Pull Request from a branch in the same project repository, then:\n\nmake sure you've checked out your branch (the one from the PR): git checkout your-branch\nwith your branch checked out, you should do a git pull origin master\nthen git push origin your-branch to update the PR.\n\nIf you forked a repo, created a branch and submit the PR, follow these steps:\n\ncreate a remote with the original project repo: git remote add upstream 'url.git.here'\nmake sure you've checked out your branch: git checkout your-branch\nget the latest changes from the upstream to your-branch: git pull upstream master\nafter that, push the changes you've got from upstream: git push origin your-branch\nfinally, you can go to GitHub page to make sure no more out-of-date is blocking your PR.\n\nAfter that, you should see that your PR is all good to be merge (after reviews is set)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-clone - Clone a repository into a new directory --reference [ -if-able ] <repository>"
},
{
"role": "assistant",
"content": "If the reference <repository> is on the local machine,\nautomatically setup .git/objects/info/alternates to\nobtain objects from the reference <repository> . Using\nan already existing repository as an alternate will\nrequire fewer objects to be copied from the repository\nbeing cloned, reducing network and local storage costs.\nWhen using the --reference-if-able , a non existing\ndirectory is skipped with a warning instead of aborting\nthe clone. NOTE : see the NOTE for the --shared option, and also the --dissociate option."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How do I merge a sub directory in Git?\nIs it possible to merge only the changes for a sub-directory from a local Git branch to a remote Git branch or is it \"all or nothing\"?\nFor example, I have:\nbranch-a\n - content-1\n - dir-1\n - content-2\n\nand\nbranch-b\n - content-1\n - dir-1\n - `content-2\n\nI only want to merge the contents of branch-a dir-1 with the contents of branch-b dir-1."
},
{
"role": "assistant",
"content": "Just as an alternative to the SO question \"How do you merge selective files with git-merge?\", I just found this GitHub thread which could be more adapted for merging a whole subdirectory, based on git read-tree:\n\n\nMy repository => cookbooks\nMy repository target directory => cookbooks/cassandra\n\nRemote repository => infochimps\nRemote repository source I want merged into cookbooks/cassandra => infochimps/cookbooks/cassandra\n\n\nHere are the commands I used to merge them\n\nAdd the repository and fetch it\ngit remote add -f infochimps git://github.com/infochimps cluster_chef.git\n\n\nPerform the merge\ngit merge --allow-unrelated-histories -s ours --no-commit infochimps/master\n\n\n\n(this performs a merge by using the 'ours' strategy (-s ours), which discards changes from the source branch.\nThis records the fact that infochimps/master has been merged, without actually modifying any file in the target branch)\n\nMerge only infochimps/cookbooks/cassandra into cassandra\ngit read-tree --prefix=cassandra/ -u infochimps/master:cookbooks/cassandra\n\n\n\nThis reads the tree for only the required source subdirectory i.e. cookbooks/cassandra, on the upstream branch of the source repository.\nNote that the target subdirectory name should also be cookbooks/cassandra, or you would see:\nfatal: Not a valid object name\n\n\nCommit the change\ngit commit -m 'merging in infochimps cassandra'\n\n\n\n\n\nAddendum\nIt's bizarre,[edit me] — but the read-tree step can possibly fail like this:\n\nerror: Entry 'infochimps/cookbooks/cassandra/README' overlaps with 'cookbooks/cassandra/README'. Cannot bind.\n\n... even when both files are identical. This might help:\ngit rm -r cassandra\ngit read-tree --prefix=cassandra/ -u infochimps/master:cookbooks/cassandra\n\nBut off course, verify manually that this does what you want."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-push - Update remote refs along with associated objects"
},
{
"role": "assistant",
"content": "REMOTES The name of one of the following can be used instead\nof a URL as <repository> argument: a remote in the Git configuration file: $GIT_DIR/config , a file in the $GIT_DIR/remotes directory, or a file in the $GIT_DIR/branches directory. All of these also allow you to omit the refspec from the command line\nbecause they each contain a refspec which git will use by default. Named remote in configuration file You can choose to provide the name of a remote which you had previously\nconfigured using git-remote , git-config or even by a manual edit to the $GIT_DIR/config file. The URL of\nthis remote will be used to access the repository. The refspec\nof this remote will be used by default when you do\nnot provide a refspec on the command line. The entry in the\nconfig file would appear like this: [remote \"<name>\"]\n\t\turl = <URL>\n\t\tpushurl = <pushurl>\n\t\tpush = <refspec>\n\t\tfetch = <refspec> The <pushurl> is used for pushes only. It is optional and defaults\nto <URL> . Pushing to a remote affects all defined pushurls or all\ndefined urls if no pushurls are defined. Fetch, however, will only\nfetch from the first defined url if multiple urls are defined. Named file in $GIT_DIR/remotes You can choose to provide the name of a\nfile in $GIT_DIR/remotes . The URL\nin this file will be used to access the repository. The refspec\nin this file will be used as default when you do not\nprovide a refspec on the command line. This file should have the\nfollowing format: URL: one of the above URL formats\n\tPush: <refspec>\n\tPull: <refspec> Push: lines are used by git push and Pull: lines are used by git pull and git fetch .\nMultiple Push: and Pull: lines may\nbe specified for additional branch mappings. Named file in $GIT_DIR/branches You can choose to provide the name of a\nfile in $GIT_DIR/branches .\nThe URL in this file will be used to access the repository.\nThis file should have the following format: <URL>#<head> <URL> is required; #<head> is optional. Depending on the operation, git will use one of the following\nrefspecs, if you don’t provide one on the command line. <branch> is the name of this file in $GIT_DIR/branches and <head> defaults to master . git fetch uses: refs/heads/<head>:refs/heads/<branch> git push uses: HEAD:refs/heads/<head>"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rebase - Reapply commits on top of another base tip"
},
{
"role": "assistant",
"content": "REBASING MERGES The interactive rebase command was originally designed to handle\nindividual patch series. As such, it makes sense to exclude merge\ncommits from the todo list, as the developer may have merged the\nthen-current master while working on the branch, only to rebase\nall the commits onto master eventually (skipping the merge\ncommits). However, there are legitimate reasons why a developer may want to\nrecreate merge commits: to keep the branch structure (or \"commit\ntopology\") when working on multiple, inter-related branches. In the following example, the developer works on a topic branch that\nrefactors the way buttons are defined, and on another topic branch\nthat uses that refactoring to implement a \"Report a bug\" button. The\noutput of git log --graph --format=%s -5 may look like this: * Merge branch 'report-a-bug'\n|\\\n| * Add the feedback button\n* | Merge branch 'refactor-button'\n|\\ \\\n| |/\n| * Use the Button class for all buttons\n| * Extract a generic Button class from the DownloadButton one The developer might want to rebase those commits to a newer master while keeping the branch topology, for example when the first topic\nbranch is expected to be integrated into master much earlier than the\nsecond one, say, to resolve merge conflicts with changes to the\nDownloadButton class that made it into master . This rebase can be performed using the --rebase-merges option.\nIt will generate a todo list looking like this: label onto\n\n# Branch: refactor-button\nreset onto\npick 123456 Extract a generic Button class from the DownloadButton one\npick 654321 Use the Button class for all buttons\nlabel refactor-button\n\n# Branch: report-a-bug\nreset refactor-button # Use the Button class for all buttons\npick abcdef Add the feedback button\nlabel report-a-bug\n\nreset onto\nmerge -C a1b2c3 refactor-button # Merge 'refactor-button'\nmerge -C 6f5e4d report-a-bug # Merge 'report-a-bug' In contrast to a regular interactive rebase, there are label , reset and merge commands in addition to pick ones. The label command associates a label with the current HEAD when that\ncommand is executed. These labels are created as worktree-local refs\n( refs/rewritten/<label> ) that will be deleted when the rebase\nfinishes. That way, rebase operations in multiple worktrees linked to\nthe same repository do not interfere with one another. If the label command fails, it is rescheduled immediately, with a helpful message how\nto proceed. The reset command resets the HEAD, index and worktree to the specified\nrevision. It is similar to an exec git reset --hard <label> , but\nrefuses to overwrite untracked files. If the reset command fails, it is\nrescheduled immediately, with a helpful message how to edit the todo list\n(this typically happens when a reset command was inserted into the todo\nlist manually and contains a typo). The merge command will merge the specified revision(s) into whatever\nis HEAD at that time. With -C <original-commit> , the commit message of\nthe specified merge commit will be used. When the -C is changed to\na lower-case -c , the message will be opened in an editor after a\nsuccessful merge so that the user can edit the message. If a merge command fails for any reason other than merge conflicts (i.e.\nwhen the merge operation did not even start), it is rescheduled immediately. By default, the merge command will use the ort merge strategy for\nregular merges, and octopus for octopus merges. One can specify a\ndefault strategy for all merges using the --strategy argument when\ninvoking rebase, or can override specific merges in the interactive\nlist of commands by using an exec command to call git merge explicitly with a --strategy argument. Note that when calling git\nmerge explicitly like this, you can make use of the fact that the\nlabels are worktree-local refs (the ref refs/rewritten/onto would\ncorrespond to the label onto , for example) in order to refer to the\nbranches you want to merge. Note: the first command ( label onto ) labels the revision onto which\nthe commits are rebased; The name onto is just a convention, as a nod\nto the --onto option. It is also possible to introduce completely new merge commits from scratch\nby adding a command of the form merge <merge-head> . This form will\ngenerate a tentative commit message and always open an editor to let the\nuser edit it. This can be useful e.g. when a topic branch turns out to\naddress more than a single concern and wants to be split into two or\neven more topic branches. Consider this todo list: pick 192837 Switch from GNU Makefiles to CMake\npick 5a6c7e Document the switch to CMake\npick 918273 Fix detection of OpenSSL in CMake\npick afbecd http: add support for TLS v1.3\npick fdbaec Fix detection of cURL in CMake on Windows The one commit in this list that is not related to CMake may very well\nhave been motivated by working on fixing all those bugs introduced by\nswitching to CMake, but it addresses a different concern. To split this\nbranch into two topic branches, the todo list could be edited like this: label onto\n\npick afbecd http: add support for TLS v1.3\nlabel tlsv1.3\n\nreset onto\npick 192837 Switch from GNU Makefiles to CMake\npick 918273 Fix detection of OpenSSL in CMake\npick fdbaec Fix detection of cURL in CMake on Windows\npick 5a6c7e Document the switch to CMake\nlabel cmake\n\nreset onto\nmerge tlsv1.3\nmerge cmake"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git - the stupid content tracker gitrevisions"
},
{
"role": "assistant",
"content": "Specifying revisions and ranges for Git"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Link to the issue number on GitHub within a commit message\n\nIs it somehow possible to automatically have a link to GitHub issue number in the git commit message?"
},
{
"role": "assistant",
"content": "Just include #xxx in your commit message to reference an issue without closing it.\nWith new GitHub issues 2.0 you can use these synonyms to reference an issue and close it (in your commit message):\n\nfix #xxx\nfixes #xxx\nfixed #xxx\nclose #xxx\ncloses #xxx\nclosed #xxx\nresolve #xxx\nresolves #xxx\nresolved #xxx\n\nYou can also substitute #xxx with gh-xxx.\nReferencing and closing issues across repos also works:\nfixes user/repo#xxx\n\nCheck out the documentation available in their Help section."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options remote.<name>.skipDefaultUpdate"
},
{
"role": "assistant",
"content": "If true, this remote will be skipped by default when updating\nusing git-fetch or the update subcommand of git-remote ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to delete .orig files after merge from git repository?\nSome how .orig files are checked in my git repository during merge, which are now displayed in modified and un-tracked sector. But I don't want this files anymore in my repository. How to do that.\n modified: Gemfile.lock.orig\n # modified: Gemfile.orig\n # modified: app/assets/images/bg_required.png.orig\n # modified: app/assets/javascripts/application.js.orig\n \n etc...\n\nAny help would be appreciated."
},
{
"role": "assistant",
"content": "Best solution in this case is to keep it simple and get rid of those files independently of git:\ncd /your/repo/directory\nfind . -name '*.orig' -delete \n\nAlternatively, in Windows/PowerShell, you can run the following command\ncd \\your\\repo\\directory\nGet-ChildItem -Recurse -Filter '*.orig' | Remove-Item"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "[Gitlab]Where can I find Gitlab Pages hosted on my private Gitlab instance?\n\nI tried to set up Gitlab Pages, until now I finished uploading my static website files👇\nUploading artifacts...\ncoverage/lcov-report: found 77 matching files \nUploading artifacts to coordinator... ok id=1038 responseStatus=201 Created token=QXJjgkf2\n\nBut I got no idea where my page hosted.\nI took a glance at this documentation but it was still vague to me.\n\nI have a private Gitlab instance.\nMy Gitlab entry is under http://abc.def.com (I configured a type A DNS to my host IP 111.111.111.111, a reverse proxy pointing at localhost:9000).\nMy project project1 is under my team team1.\nI have also configured DNS http://team1.abc.def.com to 111.111.111.111 , and there is a nginx reverse proxy on my server which http://team1.abc.def.com -> localhost:9000.\n\nI assume I should see my static page available on http://team1.abc.def.com/project1 , but nothing was there. Where exactly are my pages hosted?"
},
{
"role": "assistant",
"content": "You have to activate the pages feature. In your gitlab.rb:\npages_external_url \"IP_OF_YOUR_GITLAB\"\ngitlab_pages['enable'] = true\n\nThere is a tutorial: https://www.youtube.com/watch?v=dD8c7WNcc6s&feature=youtu.be\nAnd the complete documentation: https://docs.gitlab.com/ce/administration/pages/index.html"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Remove old remote branches from Git\nWhen I use bash autocompletion in Git, it keeps showing me branches of old remotes that I don't have anymore. When I do a git branch -la it shows those old remotes and branches while a git branch -l won't. A ls .git/refs/remotes/ also shows them. However, they are not present in my .git/config and neither are they shown when I run git remote show.\nSo how do I get rid of them because my autocomplete list is too long right now. \nI have already tried:\ngit reflog expire --expire=now --all\ngit gc --prune=now\nrm .git/refs/remotes/theoldremote\ngit remote prune theoldremote\n\nI'm also aware of the fact that I can just re-clone the repo but that's just cheating ;-)"
},
{
"role": "assistant",
"content": "Git does not delete the (local) remote-tracking branches automatically if the branch was deleted in the remote repository. Additionally, before V2.0.1 remote-tracking branches were in some cases not deleted when you removed the remote from your git config (see VonC's answer).\nTo delete stale remote-tracking branches (branches that were deleted in the remote repository) for one of your remote repositories, run\ngit remote prune <remote>\n\nTo cite the man page or git remote:\n\nprune\nDeletes all stale tracking branches under <name>. These stale branches have \n already been removed from the remote repository referenced by <name>, \n but are still locally available in \"remotes/<name>\".\nWith --dry-run option, report what branches will be pruned, but do \n not actually prune them.\n\nHowever, from your question it seems you manually removed .git/refs/remotes/theoldremote, so Git no longer knows about the remote repository that the remote-tracking branches belonged to. That's not how you're supposed to do it.\nThe normal way to remove a remote repository is to run\ngit remote rm <remote>\n\nThis will remove the remote from your .git/config, and will delete the remote-tracking branches.\nIf you just delete the directory under .git/refs/remotes/, the branches will remain behind. Then you will need to remove them manually: \ngit branch -rd <remote>/<branchname>\n\nYou need option -r to delete a remote branch."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Detail change after Git pull\nAfter a Git pull, its output gives a summary on the change amount.\nHow can I see each or some of the files detailed changes?\nOkay, here is my question to Jefromi:\n\nHow do I know if I was pulling to master? All I did is \"git pull\".\nWhat does master point to and what is the difference between master and HEAD, the two default heads of Git?\nHow do I see the detailed change in a specific file?\nHow do I see the change in the summary output by the last git pull again?\nWhat's difference between git diff and git whatchanged?"
},
{
"role": "assistant",
"content": "Suppose you're pulling to master. You can refer to the previous position of master by master@{1} (or even master@{10.minutes.ago}; see the specifying revisions section of the git-rev-parse man page), so that you can do things like\n\nSee all of the changes: git diff master@{1} master\nSee the changes to a given file: git diff master@{1} master <file>\nSee all the changes within a given directory: git diff master@{1} master <dir>\nSee the summary of changes again: git diff --stat master@{1} master\n\nAs for your question of \"how do I know if I'm on master\"... well, using branches is an important part of the Git workflow. You should always be aware of what branch you're on - if you pulled changes, you want to pull them to the right branch! You can see a list of all branches, with an asterisk by the currently checked-out one, with the command git branch. The current branch name is also printed along with the output of git status. I highly recommend skimming the man pages of commands to use - it's a great way to slowly pick up some knowledge.\nAnd your last question: HEAD is the name for the currently checked out branch. You can indeed use HEAD and HEAD@{1} in this context as well, but it's a bit more robust to use the branches, since if you go and check out another branch. HEAD is now that second branch, and HEAD@{1} is now master - not what you want!\nTo save having to ask a lot of little questions like this, you should probably have a look at a Git tutorial. There are a million on the web, for example:\n\nThe Pro Git book\nGit Magic\nand the 4.5 million hits on Google for \"Git tutorial\""
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options browser.<tool>.path"
},
{
"role": "assistant",
"content": "Override the path for the given tool that may be used to\nbrowse HTML help (see -w option in git-help ) or a\nworking repository in gitweb (see git-instaweb )."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What does \"upload-pack: not our ref\" mean, when fetching git refs via --tags?\nIn one of my projects, the Travis builds are failing before any of my build-system or code can be reached, as soon as my build-script attempts to fetch all of the Git tags with git fetch --tags:\n`` git fetch --tags --verbose\nPOST git-upload-pack (350 bytes)\nPOST git-upload-pack (788 bytes)\nPOST git-upload-pack (797 bytes)\nFrom https://github.com/ELLIOTTCABLE/bs-sedlex\n = [up to date] fix-ci -> origin/fix-ci\n * [new tag] sedlex-1.99.2 -> sedlex-1.99.2\n * [new tag] v1.99.3 -> v1.99.3\n...\n * [new tag] v20.0.0-pre.2 -> v20.0.0-pre.2\nFetching submodule ppx-sedlex\nPOST git-upload-pack (122 bytes)\nFrom https://github.com/ELLIOTTCABLE/ppx-sedlex\n = [up to date] develop -> origin/develop\n = [up to date] master -> origin/master\n...\n = [up to date] v20.0.0-pre.2 -> v20.0.0-pre.2\nPOST git-upload-pack (4 bytes)\nPOST git-upload-pack (69 bytes)\nPOST git-upload-pack (586 bytes)\nfatal: remote error: upload-pack: not our ref 0f509703fcd43ff4324d721a39220153bab49d4a\n\nThis is especially confusing, as neither the main repo bs-sedlex, nor the git-submodule ppx-sedlex, have any commit starting like 0f5097...; I have no idea where that SHA is coming from. This failure is occurring only on the Linux workers, and I can't figure out why — git fetch --tags on that same repo works on the macOS Travis-workers, on my macOS machine, and on an Ubuntu Vagrant box I spun-up to debug this.\nWhat does the \"fatal: remote error: upload-pack: not our ref\" error signify; and how can I work around it? I'm not even sure where to begin debugging this error, as it only occurs specifically on Travis workers.\n(It's unlikely to be helpful, but here's the error in context, and the repository in question.)\nEdit 1: Here's some additional interesting output, from adding GIT_TRACE=2:\nFetching submodule ppx-sedlex\n23:55:28.125076 git.c:439 trace: built-in: git fetch --no-prune --no-prune-tags --tags -v --recurse-submodules-default on-demand --submodule-prefix ppx-sedlex/\n23:55:28.125914 run-command.c:663 trace: run_command: git-remote-https origin https://github.com/ELLIOTTCABLE/ppx-sedlex.git\n23:55:28.429609 run-command.c:663 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs\n23:55:28.432485 run-command.c:663 trace: run_command: git rev-list --objects --stdin --not --all --quiet --alternate-refs\n23:55:28.434082 git.c:439 trace: built-in: git rev-list --objects --stdin --not --all --quiet --alternate-refs\nFrom https://github.com/ELLIOTTCABLE/ppx-sedlex\n = [up to date] develop -> origin/develop\n = [up to date] master -> origin/master\n = [up to date] v1.99.4 -> v1.99.4\n = [up to date] v1.99.4-pre.1 -> v1.99.4-pre.1\n = [up to date] v1.99.4-pre.3 -> v1.99.4-pre.3\n = [up to date] v1.99.4-pre.8 -> v1.99.4-pre.8\n = [up to date] v2.0.0 -> v2.0.0\n = [up to date] v20.0.0-pre.1 -> v20.0.0-pre.1\n = [up to date] v20.0.0-pre.2 -> v20.0.0-pre.2\n23:55:28.442482 run-command.c:1616 run_processes_parallel: preparing to run up to 1 tasks\n23:55:28.442504 run-command.c:1648 run_processes_parallel: done\n23:55:28.442536 run-command.c:663 trace: run_command: git gc --auto\n23:55:28.443983 git.c:439 trace: built-in: git gc --auto\n23:55:28.444903 run-command.c:663 trace: run_command: cd /home/vagrant/ELLIOTTCABLE/bs-sedlex/.git/modules/ppx-sedlex; unset GIT_PREFIX; GIT_DIR=. git fetch --no-prune --no-prune-tags --tags -v --recurse-submodules-default on-demand --submodule-prefix ppx-sedlex/ origin 0f509703fcd43ff4324d721a39220153bab49d4a\n23:55:28.446392 git.c:439 trace: built-in: git fetch --no-prune --no-prune-tags --tags -v --recurse-submodules-default on-demand --submodule-prefix ppx-sedlex/ origin 0f509703fcd43ff4324d721a39220153bab49d4a\n23:55:28.447105 run-command.c:663 trace: run_command: git-remote-https origin https://github.com/ELLIOTTCABLE/ppx-sedlex.git\n23:55:28.735871 run-command.c:663 trace: run_command: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --no-progress https://github.com/ELLIOTTCABLE/ppx-sedlex.git/\n23:55:28.738885 git.c:439 trace: built-in: git fetch-pack --stateless-rpc --stdin --lock-pack --thin --no-progress https://github.com/ELLIOTTCABLE/ppx-sedlex.git/\nerror: Server does not allow request for unadvertised object 0f509703fcd43ff4324d721a39220153bab49d4a\n\nI can't make hide-nor-hair of why Git is requesting an \"unadvertised object\" here; but it's clearly not a GitHub problem, here — for some reason, the command:\ngit fetch --no-prune --no-prune-tags --tags -v \\\n --recurse-submodules-default on-demand \\ \n --submodule-prefix ppx-sedlex/ \\\n origin 0f509703fcd43ff4324d721a39220153bab49d4a\n\n... is being automatically invoked upon the submodule, when I git fetch in the parent repo. (Again, that commit, 0f509703, does not exist in either repo; again, the exact same repo, the exact same commit, and this isn't happening on macOS — only on Travis's Linux machines.)"
},
{
"role": "assistant",
"content": "I had the same error:\nradato$ git submodule update \nfatal: git upload-pack: not our ref somehash0\nfatal: remote error: upload-pack: not our ref somehash0\nfatal: Fetched in submodule path 'dashboard', but it did not contain somehash0. Direct fetching of that commit failed.\n\nSo I deinitialized the submodule:\nradato$ git submodule deinit -f dashboard\nCleared directory 'dashboard'\nSubmodule 'dashboard' (ssh://[email protected]/somedomain/dashboard.git) unregistered for path 'dashboard'\n\nNow checking the summary I get\nradato@$ git submodule summary \n* somepath1 somehash1 (2):\n < Merged in fixed_edge (pull request #2)\n < fixed broken test\n\n* somepath2 somehash2 (2):\n < Merged in dsp_tx_freq (pull request #14)\n < Merged in v0.2.0 (pull request #13)\n\nEventually I pulled:\nradato@$ git pull --prune --recurse-submodules --force \nFetching submodule dashboard\nFetching submodule somepath1\nFetching submodule somepath2\nAlready up to date.\nSubmodule path 'somesubmodulepath1': checked out 'somehash1'\nSubmodule path 'somesubmodulepath2': checked out 'somehash2'\n\nAnd now it works again. Here is the status\nradato$ git status \nOn branch develop\nYour branch is up to date with 'origin/develop'.\n\nnothing to commit, working tree clean"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is `git checkout --orphan` used for?\nI've just discovered git checkout --orphan, but I don't know how to use it. Its help page says it creates a new unparented branch. \nIn the master branch, I've tried git checkout --orphan br, only to see the files in the working directory change to “Changes to be committed”, and the git log saying fatal: bad default revision 'HEAD'.\nSo what's the advantage of using git checkout --orphan?"
},
{
"role": "assistant",
"content": "The core use for git checkout --orphan is to create a branch in a git init-like state on a non-new repository.\nWithout this ability, all of your git branches would have a common ancestor, your initial commit. This is a common case, but in no way the only one. For example, git allows you to track multiple independent projects as different branches in a single repository.\nThat's why your files are being reported as “changes to be committed”: in a git init state, the first commit isn't created yet, so all files are new to git."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Android Studio not committing to GitHub\n\nI am trying to use git in Android Studio. If I choose commit changes, it says that it has successfully committed the changed files but those changes do not appear on the GitHub. Instead, if I delete the repository from GitHub and choose Share Project on GitHub, it successfully creates a new repository and uploads the files into it. This means that the connection is fine. Also, I have checked the gitignore file, the java files are not in that list. What could be the problem?"
},
{
"role": "assistant",
"content": "You have to select \"commit and push\".\nIf you want to upload (push) the changes that you made, go to:\nVCS -> Git -> PUSH\n\nOnly after \"pushing\", your changes will be uploaded to GitHub.\nIf you select \"commit\", your changes would remain local."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fetch - Download objects and refs from another repository fetch.output"
},
{
"role": "assistant",
"content": "Control how ref update status is printed. Valid values are full and compact . Default value is full . See the\nOUTPUT section in git-fetch for details."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitrevisions - Specifying revisions and ranges for Git <rev>^{<type>} , e.g. v0.99.8^{commit}"
},
{
"role": "assistant",
"content": "A suffix ^ followed by an object type name enclosed in\nbrace pair means dereference the object at <rev> recursively until\nan object of type <type> is found or the object cannot be\ndereferenced anymore (in which case, barf).\nFor example, if <rev> is a commit-ish, <rev>^{commit} describes the corresponding commit object.\nSimilarly, if <rev> is a tree-ish, <rev>^{tree} describes the corresponding tree object. <rev>^0 is a short-hand for <rev>^{commit} . <rev>^{object} can be used to make sure <rev> names an\nobject that exists, without requiring <rev> to be a tag, and\nwithout dereferencing <rev> ; because a tag is already an object,\nit does not have to be dereferenced even once to get to an object. <rev>^{tag} can be used to ensure that <rev> identifies an\nexisting tag object."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Git-Based Source Control in the Enterprise: Suggested Tools and Practices?\nI use git for personal projects and think it's great. It's fast, flexible, powerful, and works great for remote development.\nBut now it's mandated at work and, frankly, we're having problems.\nOut of the box, git doesn't seem to work well for centralized development in a large (20+ developer) organization with developers of varying abilities and levels of git sophistication - especially compared with other source-control systems like Perforce or Subversion, which are aimed at that kind of environment. (Yes, I know, Linus never intended it for that.)\nBut - for political reasons - we're stuck with git, even if it sucks for what we're trying to do with it.\nHere are some of the things we're seeing:\n\nThe GUI tools aren't mature\nUsing the command line tools, it's far to easy to screw up a merge and obliterate someone else's changes\nIt doesn't offer per-user repository permissions beyond global read-only or read-write privileges\nIf you have a permission to ANY part of a repository, you can do that same thing to EVERY part of the repository, so you can't do something like make a small-group tracking branch on the central server that other people can't mess with.\nWorkflows other than \"anything goes\" or \"benevolent dictator\" are hard to encourage, let alone enforce \nIt's not clear whether it's better to use a single big repository (which lets everybody mess with everything) or lots of per-component repositories (which make for headaches trying to synchronize versions).\nWith multiple repositories, it's also not clear how to replicate all the sources someone else has by pulling from the central repository, or to do something like get everything as of 4:30 yesterday afternoon.\n\nHowever, I've heard that people are using git successfully in large development organizations. \nIf you're in that situation - or if you generally have tools, tips and tricks for making it easier and more productive to use git in a large organization where some folks are not command line fans - I'd love to hear what you have to suggest.\nBTW, I've asked a version of this question already on LinkedIn, and got no real answers but lots of \"gosh, I'd love to know that too!\"\nUPDATE: Let me clarify...\nWhere I work, we can't use ANYTHING other than git. It's not an option. We're stuck with it. We can't use mercurial, svn, bitkeeper, Visual Source Safe, ClearCase, PVCS, SCCS, RCS, bazaar, Darcs, monotone, Perforce, Fossil, AccuRev, CVS, or even Apple's good ol' Projector that I used in 1987. So while you're welcome to discuss other options, you ain't gonna get the bounty if you don't discuss git.\nAlso, I'm looking for practical tips on how to use git in the enterprise. I put a whole laundry list of problems we're having at the top of this question. Again, people are welcome to discuss theory, but if you want to earn the bounty, give me solutions."
},
{
"role": "assistant",
"content": "Against the common opinion, I think that using a DVCS is an ideal choice in an enterprise setting because it enables very flexible workflows. I will talk about using a DVCS vs. CVCS first, best-practices and then about git in particular.\nDVCS vs. CVCS in an enterprise context:\nI wont talk about the general pros/cons here, but rather focus on your context. It is the common conception, that using a DVCS requires a more disciplined team than using a centralized system. This is because a centralized system provides you with an easy way to enforce your workflow, using a decentralized system requires more communication and discipline to stick to the established of conventions. While this may seem like it induces overhead, I see benefit in the increased communication necessary to make it a good process. Your team will need to communicate about code, about changes and about project status in general.\nAnother dimension in the context of discipline is encouraging branching and experiments. Here's a quote from Martin Fowler's recent bliki entry on Version Control Tools, he has found a very concise description for this phenomenon.\n\nDVCS encourages quick branching for\n experimentation. You can do branches\n in Subversion, but the fact that they\n are visible to all discourages people\n from opening up a branch for\n experimental work. Similarly a DVCS\n encourages check-pointing of work:\n committing incomplete changes, that\n may not even compile or pass tests, to\n your local repository. Again you could\n do this on a developer branch in\n Subversion, but the fact that such\n branches are in the shared space makes\n people less likely to do so.\n\nDVCS enables flexible workflows because they provide changeset tracking via globally unique identifiers in a directed acyclic graph (DAG) instead of simple textual diffs. This allows them to transparently track the origin and history of a changeset, which can be quite important.\nWorkflows:\nLarry Osterman (a Microsoft dev working on the Windows team) has a great blog post about the workflow they employ at the Windows team. Most notably they have:\n\nA clean, high quality code only trunk (master repo)\nAll development happens on feature branches\nFeature teams have team repos\nThey do regularily merge the latest trunk changes into their feature branch (Forward Integrate)\nComplete features must pass several quality gates e.g. review, test coverage, Q&A (repos on their own)\nIf a feature is completed and has acceptable quality it is merged into the trunk (Reverse Integrate)\n\nAs you can see, having each of these repositories live on their own you can decouple different teams advancing at different paces. Also the possibility to implement a flexible quality gate system distinguishes DVCS from a CVCS. You can solve your permission issues at this level too. Only a handful of people should be allowed access to the master repo. For each level of the hierachy, have a seperate repo with the corresponding access policies. Indeed, this approach can be very flexible on the team level. You should leave it up to each team to decide wether they want to share their team repo among themselves or if they want a more hierachical approach where only the team lead may commit to the team repo. \n\n(The picture is stolen from Joel Spolsky's hginit.com.)\nOne thing remains to be said at this point though:- even though DVCS provides great merging capabilities, this is never a replacement for using Continuous Integration. Even at that point you have a great deal of flexibility: CI for the trunk repo, CI for team repos, Q&A repos etc. \nGit in an enterprise context:\nGit is maybe not the ideal solution for an enterprise context as you have already pointed out. Repeating some of your concerns, I think most notably they are:\n\n Still somewhat immature support on Windows (please correct me if that changed recently) Now windows has github windows client , tortoisegit , SourceTree from atlassian \nLack of mature GUI tools, no first class citizen vdiff/merge tool integration\nInconsistent interface with a very low level of abstractions on top of its inner workings\nA very steep learning curve for svn users\nGit is very powerful and makes it easy to modify history, very dangerous if you don't know what you are doing (and you will sometimes even if you thought you knew)\nNo commercial support options available\n\nI don't want to start a git vs. hg flamewar here, you have already done the right step by switching to a DVCS. Mercurial addresses some of the points above and I think it is therefore better suited in an enterprise context:\n\nAll plattforms that run python are supported\nGreat GUI tools on all major plattforms (win/linux/OS X), first class merge/vdiff tool integration \nVery consistent interface, easy transition for svn users\nCan do most of the things git can do too, but provides a cleaner abstraction. Dangerous operations are are always explicit. Advanced features are provided via extensions that must explicitly be enabled.\nCommercial support is available from selenic.\n\nIn short, when using DVCS in an enterprise I think it's important to choose a tool that introduces the least friction. For the transition to be successful it's especially important to consider the varying skill between developers (in regards to VCS).\n\nReducing friction:\nOk, since you appear to be really stuck with the situation, there are two options left IMHO.\n There is no tool to make git less complicated; git is complicated. Either you confront this or work around git:-\n\nGet a git introductory course for the whole team. This should include the basics only and some exercises (important!).\nConvert the master repo to svn and let the \"young-stars\" git-svn. This gives most of the developers an easy to use interface and may compensate for the lacking discipline in your team, while the young-stars can continue to use git for their own repos.\n\nTo be honest, I think you really have a people problem rather than a tool problem. What can be done to improve upon this situation?\n\nYou should make it clear that you think your current process will end up with a maintainable codebase.\nInvest some time into Continous Integration. As I outlined above, regardless which kind of VCS you use, there's never a replacement for CI. You stated that there are people who push crap into the master repo: Have them fix their crap while a red alert goes off and blames them for breaking the build (or not meeting a quality metric or whatever)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options diff.<driver>.wordRegex"
},
{
"role": "assistant",
"content": "The regular expression that the diff driver should use to\nsplit words in a line. See gitattributes for\ndetails."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-cat-file - Provide contents or details of repository objects"
},
{
"role": "assistant",
"content": "DESCRIPTION Output the contents or other properties such as size, type or delta\ninformation of one or more objects. This command can operate in two modes, depending on whether an option\nfrom the --batch family is specified. In non-batch mode, the command provides information on an object\nnamed on the command line. In batch mode, arguments are read from standard input."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Project management to go with GitHub [closed]\n\nClosed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.\n \n \n\n\n\n\n\n\n\n\n\n\n\n We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.\n\n\nClosed 9 years ago.\n\n\n\n\n\n\n\n Improve this question\n \n\n\n\n(EDIT: This question is now outdated for my particular issue, as Google Code supports git now and I've converted Protocol Buffers to Mercurial anyway. However, it's still of general interest, IMO.)\nMy C# Protocol Buffers Port uses github for its source control, and I'm beginning to really enjoy using git. However, as far as I can tell, github doesn't provide any project management tools: defect and feature tracking, discussions, feature requests, docs etc. Given my affiliations, Google Code would be a natural choice, but it would seem odd to create a project there but host the source on github.\nThis question about Fogbugz/Assembla seems to mostly focus on the defect tracking. I was wondering what experiences others have had when it comes to a more \"complete\" project management solution. Does Fogbugz actually do everything I need? (Using a wiki for docs has its advantages, although I also want to be able to distribute documentation with the code.) Beyond the explicit features mentioned in the first paragraph, are there other project aspects I should be considering which I may have missed?\nThis will definitely stay an open source project, and although I'd rather not pay I don't mind if a small fee is required. Currently I'm the only developer, but that may change and there may very well be lots of people filing bugs and feature requests. (In other words, I hope and expect it to be popular, but with me doing most of the work.)\nPreviously I've contributed to various open source projects, but haven't done much in the way of running a very visible and active one. (MiscUtil is currently still \"hosted\" on my website, with occasional releases - the actual source control is on my local NAS.)\nAnyone care to share their experiences?\nEDIT: Another option I'm now considering is a Google Code project (I really would like to be loyal to my employer) and an occasional merge from git to svn (at the very least, every time I do a release). This would allow non-git users to get hold of the source easily too."
},
{
"role": "assistant",
"content": "If you're thinking that you'll really be the only developer, Fogbugz will help you keep your sanity. Fogbugz is a great product, It builds focused communications and can turn anything into a case (issue). It does all that as well as any system I've seen. \nBut its orientation is commercial -- efficient communication between users and tech support, improve reliability of schedules, focus & prioritize what's being worked on, separate internal & external discussions, some good reporting to track that things are getting handled. (About the only criticism I can think of is it doesn't do case blocking and dependency tracking, which is really useful for those bugs buried deep.) \nLittle of this feature set will help you build an active open source project, with open lively communication and the need build a community and have users evolve into developers as the project grows. So if that's where you want to end up, you may really want the less focused communication channels of one of these lightweight tracking systems. \nI haven't used Google Code on a project yet, but in terms of transparent & open communication, it looks like a good support for an active open source project. Plus you already know it. If you want to grow the involvement in your project, Google code looks like the way to go."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-diff - Show changes between commits, commit and working tree, etc --patch-with-stat"
},
{
"role": "assistant",
"content": "Synonym for -p --stat ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Modified files in a git branch are spilling over into another branch\nI am working on a git repository with a master branch and another the topic branch. I have switched to topic branch and modified a file. Now, if I switched to the master branch, that same file is shown as modified.\nFor example:\ngit status in git-build branch:\n# On branch git-build\n# Changes to be committed:\n# (use \"git reset HEAD <file>...\" to unstage)\n#\n# modified: cvsup_current\n#\n\nSwitch to master branch\n[root@redbull builder_scripts (git-build)]# git co master\nM builder_scripts/cvsup_current\nSwitched to branch \"master\"\n\ngit status in master branch\n[root@redbull builder_scripts (master)]# git status\n# On branch master\n# Changes to be committed:\n# (use \"git reset HEAD <file>...\" to unstage)\n#\n# modified: cvsup_current\n#\n\nWhy is that the file is shown as modified in the master branch even though it was modified in git-build branch?\nMy understanding was that the branches are independent of each other and when I change from one branch to another the changes do not \"spill over\" from one branch to another. So I am obviously missing something here.\nHas anyone got a clue stick?"
},
{
"role": "assistant",
"content": "Why is that the file is shown as modified in master branch even though it was modified in git-build branch?\n\nThe key to remember is that the file was not modified in the git-build branch. It was only modified in your working copy.\nOnly when you commit are the changes put back into whichever branch you have checked out"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options core.repositoryFormatVersion"
},
{
"role": "assistant",
"content": "Internal variable identifying the repository format and layout\nversion."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to use Git?\nI am an engineering student who spends most of his spare time watching TV rather than coding. So basically I have zero experience with any kind of version control system. My understanding is somehow they make distribution of projects easier.\nI was looking into Blueprint CSS Framework, liked it and downloaded from their Git project page. Now, I know Git does much more than providing a link on their website. So my questions are the following:\n\nHow do I use Git properly to keep my Blueprint download updated? Say there is a new version, what do I do?\nCan I update all Git downloads at the same time? Say I have Blueprint and other projects downloaded on my Mac, how can I update them efficiently?\n\nI looked into Git guide, but it's mostly for the people who have much more experience than I have. \nThanks for help :)"
},
{
"role": "assistant",
"content": "Have a look at git for designers for great one page article/high level intro to the topic. (That link is broken: Here is a link to another Git for Designers )\nI would start at http://git-scm.com/documentation, there are documents and great video presentations for non-software-developer/cs users. Git for beginners have some basic stuff."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fast-import - Backend for fast Git data importers Delimited format"
},
{
"role": "assistant",
"content": "A delimiter string is used to mark the end of the data.\nfast-import will compute the length by searching for the delimiter.\nThis format is primarily useful for testing and is not\nrecommended for real data. 'data' SP '<<' <delim> LF\n\t<raw> LF\n\t<delim> LF\n\tLF? where <delim> is the chosen delimiter string. The string <delim> must not appear on a line by itself within <raw> , as otherwise\nfast-import will think the data ends earlier than it really does. The LF immediately trailing <raw> is part of <raw> . This is one of\nthe limitations of the delimited format, it is impossible to supply\na data chunk which does not have an LF as its last byte. The LF after <delim> LF is optional (it used to be required)."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-svn - Bidirectional operation between a Subversion repository and Git svn.noMetadata svn-remote.<name>.noMetadata"
},
{
"role": "assistant",
"content": "This gets rid of the git-svn-id: lines at the end of every commit. This option can only be used for one-shot imports as git svn will not be able to fetch again without metadata. Additionally,\nif you lose your $GIT_DIR/svn/**/.rev_map.* files, git svn will not\nbe able to rebuild them. The git svn log command will not work on repositories using\nthis, either. Using this conflicts with the useSvmProps option for (hopefully) obvious reasons. This option is NOT recommended as it makes it difficult to track down\nold references to SVN revision numbers in existing documentation, bug\nreports, and archives. If you plan to eventually migrate from SVN to\nGit and are certain about dropping SVN history, consider git-filter-repo instead.\nfilter-repo also allows reformatting of metadata for ease-of-reading\nand rewriting authorship info for non-\"svn.authorsFile\" users."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options instaweb.browser"
},
{
"role": "assistant",
"content": "Specify the program that will be used to browse your working\nrepository in gitweb. See git-instaweb ."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Cloning a repo from someone else's Github and pushing it to a repo on my Github\nI cloned the repo at https://github.com/railstutorial/sample_app_rails_4 and made a lot of changes to it (I used it as a starting point for my own app), and now I would like to push the changed app to a repo on my own github account. \nHow can I change what github repo it is linked to?"
},
{
"role": "assistant",
"content": "As Deefour says, your situation isn't much unlike the one in Change the URI (URL) for a remote Git repository. When you clone a repository, it is added as a remote of yours, under the name origin. What you need to do now (as you're not using the old source anymore) is change origin's URL:\n$ git remote set-url origin http://github.com/YOU/YOUR_REPO\n\nIf the original repository would update often and you want to get those updates from time to time, then instead of editing origin it would be best to add a new remote:\n$ git remote add personal http://github.com/YOU/YOUR_REPO\n\nOr maybe even call the old one upstream:\n$ git remote rename origin upstream\n$ git remote add origin http://github.com/YOU/YOUR_REPO\n\nThen, whenever you want to get changes from upstream, you can do:\n$ git fetch upstream\n\nAs this the source is a sample repository (seems to be kind of a template to start off), I don't think there's a need to keep it nor fork it at all - I'll go with the first alternative here."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-list - Lists commit objects in reverse chronological order --exclude-promisor-objects"
},
{
"role": "assistant",
"content": "(For internal use only.) Prefilter object traversal at\npromisor boundary. This is used with partial clone. This is\nstronger than --missing=allow-promisor because it limits the\ntraversal, rather than just silencing errors about missing\nobjects."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "How to find commits by a specific user in Git? [duplicate]\nThis question already has answers here:\n \n \n\n\n\n\nHow can I view a git log of just one user's commits?\n\n (16 answers)\n \n\nClosed 10 years ago.\n\n\n\nOur project uses Git as the version control system and recently I needed to review someone's commits. How can I see a list of commits made by a specific user?"
},
{
"role": "assistant",
"content": "git log --author=<pattern> will show the commit log filtered for a particular author. (--committer can be used for committer if the distinction is necessary).\nhttp://git-scm.com/docs/git-log"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "gitattributes - Defining attributes per path union"
},
{
"role": "assistant",
"content": "Run 3-way file level merge for text files, but take\nlines from both versions, instead of leaving conflict\nmarkers. This tends to leave the added lines in the\nresulting file in random order and the user should\nverify the result. Do not use this if you do not\nunderstand the implications."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-fetch - Download objects and refs from another repository --refetch"
},
{
"role": "assistant",
"content": "Instead of negotiating with the server to avoid transferring commits and\nassociated objects that are already present locally, this option fetches\nall objects as a fresh clone would. Use this to reapply a partial clone\nfilter from configuration or using --filter= when the filter\ndefinition has changed. Automatic post-fetch maintenance will perform\nobject database pack consolidation to remove any duplicate objects."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-for-each-ref - Output information on each ref"
},
{
"role": "assistant",
"content": "DESCRIPTION Iterate over all refs that match <pattern> and show them\naccording to the given <format> , after sorting them according\nto the given set of <key> . If <count> is given, stop after\nshowing that many refs. The interpolated values in <format> can optionally be quoted as string literals in the specified\nhost language allowing their direct evaluation in that language."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Visual Studio Code how to resolve merge conflicts with git?\nI tried to merge my branch with another branch and there was a merge conflict. In Visual Studio Code (version 1.2.1) I resolved all of the issues, however when I try to commit it keeps giving me this message:\n\nYou should first resolve the un-merged changes before committing your changes.\n\nI've tried googling it but I can't find out why it won't let me commit my changes, all of the conflicts have disappeared."
},
{
"role": "assistant",
"content": "With VSCode you can find the merge conflicts easily with the following UI. \n\n(if you do not have the topbar, set \"editor.codeLens\": true in User Preferences)\nIt indicates the current change that you have and incoming change from the server. This makes it easy to resolve the conflicts - just press the buttons above <<<< HEAD.\nIf you have multiple changes and want to apply all of them at once - open command palette (View -> Command Palette) and start typing merge - multiple options will appear including Merge Conflict: Accept Incoming, etc."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-merge - Join two or more development histories together ours"
},
{
"role": "assistant",
"content": "This option forces conflicting hunks to be auto-resolved cleanly by\nfavoring our version. Changes from the other tree that do not\nconflict with our side are reflected in the merge result.\nFor a binary file, the entire contents are taken from our side. This should not be confused with the ours merge strategy, which does not\neven look at what the other tree contains at all. It discards everything\nthe other tree did, declaring our history contains all that happened in it."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-config - Get and set repository or global options pack.deltaCacheSize"
},
{
"role": "assistant",
"content": "The maximum memory in bytes used for caching deltas in git-pack-objects before writing them out to a pack.\nThis cache is used to speed up the writing object phase by not\nhaving to recompute the final delta result once the best match\nfor all objects is found. Repacking large repositories on machines\nwhich are tight with memory might be badly impacted by this though,\nespecially if this cache pushes the system into swapping.\nA value of 0 means no limit. The smallest size of 1 byte may be\nused to virtually disable this cache. Defaults to 256 MiB."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Push a commit in two branches with Git\nhow do I push a commit in two branches? \nI can't use \"git push\", because then it pushes to three branches, and i just want the commit in two of them.. \nIve tried a \"git merge HEAD --commit id from branch A--\" in branch B, but then it takes everything from branch A and merges with branch B. I just want the last commit and not everything else merged with branch B.\nAnyone know what to do?"
},
{
"role": "assistant",
"content": "Short answer\nYou can apply already existing commit to another branch using cherry-pick command, and then push both branches using git push origin branchA branchB.\n\nWhy pushing a commit in two branches might be useful\nAssume you have a repository with this structure:\nA--B--C--D ← master ← HEAD\n \\--E ← v1-release\n\nAfter some development (commits A, B, C) project was released and v1-release branch was created (so that v1 can be supported with bugfixes and next version can be developed in master). Commit E was used to specify version information (added release notes, etc). Commit D introduced new feature, which is planned for the next version and should not appear in v1-release.\nNow, if a bug is found in v1-release, it must be fixed in both branches, so that users can continue using v1 and it does not appear in the next version.\nAfter fixing the bug in master, repository should look like this:\nA--B--C--D--F ← master ← HEAD\n \\--E ← v1-release\n\nNow commit F with a bugfix must be applied to v1-release branch.\nHow to actually do it\nCommits cannot be exactly copied (since commit is a directory saved state), but you can apply changes made in commit to another commit.\ncherry-pick command does exactly that. It applies changes made by a specified commit to the current branch, creating new commit:\ngit checkout v1-release\ngit cherry-pick F\n\nAfter this, repository should look like this:\nA--B--C--D--F ← master\n \\--E--G ← v1-release ← HEAD\n\nCommit G introduces same changes as F.\nYou may have to resolve conflicts (exactly like after merge).\nError message\n\nThe previous cherry pick was now empty ...\n\nmeans that changes made by cherry-picked commit are already present in current branch. You probably forgot to checkout correct branch.\nIn case of errors or conflicts cherry-pick can be aborted using git cherry-pick --abort.\nFinally, you can return to master branch and push both branches to remote repository:\ngit checkout master\ngit push origin master v1-release\n\nFinal repository structure:\nA--B--C--D--F ← master ← HEAD\n \\--E--G ← v1-release"
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-rev-list - Lists commit objects in reverse chronological order --show-signature"
},
{
"role": "assistant",
"content": "Check the validity of a signed commit object by passing the signature\nto gpg --verify and show the output."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Override configured user for a single git commit\nI am trying to commit to a project on github.com from my work laptop, which is already configured for the company git server. Is there a way to commit specifying different author credentials, possible using a different configuration file or orther command line switches?\nI've tried using\n--author=\"My Name <[email protected]>\" \n\nand I received the message: \n Committer: unknown <[email protected]>\nYour name and email address were configured automatically based\non your username and hostname. Please check that they are accurate.\nYou can suppress this message by setting them explicitly:\n\n git config --global user.name \"Your Name\"\n git config --global user.email [email protected]\n\nAfter doing this, you may fix the identity used for this commit with:\n\n git commit --amend --reset-author\n\nbut it still didn't update my username for committing to the github.com project. Is there anything else I can try and is it even possible?"
},
{
"role": "assistant",
"content": "First, the author is not necessarily the same as the committer. Git tracks both.\nTo set what name to use for just this repository, you could do:\ngit config user.name \"Your Name\"\ngit config user.email \"Your email\"\n\nNotice the absence of the --global option. This will set the configuration in this repository only.\nAlternatively, you can do this for only a single command, using the -c option:\ngit -c \"user.name=Your Name\" -c \"user.email=Your email\" commit ...\n\nBut I think it's better to just use the config options above."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "git-for-each-ref - Output information on each ref objecttype"
},
{
"role": "assistant",
"content": "The type of the object ( blob , tree , commit , tag )."
}
] |
[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "When would you use .git/info/exclude instead of .gitignore to exclude files?\nI am a bit confused about the pros and cons of using .git/info/exclude and .gitignore to exclude files.\nBoth of them are at the level of the repository/project, so how do they differ and when should we use .git/info/exclude ?"
},
{
"role": "assistant",
"content": "The first advantage of .gitignore is that it is versioned into the repository itself, unlike .git/info/exclude. The second advantage is that you can have multiple .gitignore files, one per directory/subdirectory, for directory specific ignore rules, unlike .git/info/exclude.\nSo the .gitignore files are versioned and present across all clones of the repository. Therefore, in large teams all people are ignoring the same kind of files (e.g. *.db, *.log); and using several .gitignore files allow for more specific ignore rules.\n.git/info/exclude is available for individual clones only. It is not versioned, hence what one person ignores in their clone is not available/present in another person's clone. For example, if someone uses Eclipse for development, it may make sense for that developer to add .build folder to .git/info/exclude because other devs may not be using Eclipse.\nIn general, files/ignore rules that have to be universally ignored should go in .gitignore, and otherwise files that you want to ignore only on your local clone should go into .git/info/exclude."
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.