git

Multiple diff Tools

只谈情不闲聊 提交于 2021-02-18 20:11:15
问题 I had set up my git to use P4Merge as the diff tool, as described here. So, git diff will trigger the P4Merge. However, sometimes I find working with the UNIX diff is faster and more efficient (because no GUI involved). How do I set up git so that I can easily choose which diff tool I would like to trigger? Is this possible? For example: $ git diff # to trigger P4Merge $ git difftool # to trigger UNIX diff My git config --list : code.editor=vi merge.tool=p4merge mergetool.extMerge.cmd

Multiple diff Tools

橙三吉。 提交于 2021-02-18 20:05:23
问题 I had set up my git to use P4Merge as the diff tool, as described here. So, git diff will trigger the P4Merge. However, sometimes I find working with the UNIX diff is faster and more efficient (because no GUI involved). How do I set up git so that I can easily choose which diff tool I would like to trigger? Is this possible? For example: $ git diff # to trigger P4Merge $ git difftool # to trigger UNIX diff My git config --list : code.editor=vi merge.tool=p4merge mergetool.extMerge.cmd

Is it possible to add and commit files outside of a git repository?

删除回忆录丶 提交于 2021-02-18 18:20:27
问题 We have text files spreaded in all corner of the system, and we were planing to add all modifications made in these files to a git repository. Every time a modification is made to these files, it is made by a script. So, we were planing to add new commands to that script to add the files to a git repository. But, these modifications are concurrent. We could build a path to each file representing the original location from their original paths. Is there possible to add these files to a git

remote: Forbidden fatal: unable to access

♀尐吖头ヾ 提交于 2021-02-18 17:57:05
问题 I have access to repo, I clone it by https, then I made my changes and I commit those change and create new_branch and try to push I got this: git push origin new_branch remote: Forbidden fatal: unable to access 'https://username@bitbucket.org/main-account/repo.git/': The requested URL returned error: 403 I already setup my SSH key, git global config and already logged ssh -T username@bitbucket.org logged in as username You can use git or hg to connect to Bitbucket. Shell access is disabled

Git repository without history

点点圈 提交于 2021-02-18 17:49:29
问题 Is it possible to have a Git repository without history? For example, I have a local Git repository where I work and I want to push the latest version to the production server. No history should be stored on the production server. How can I do that? 回答1: You can see if the command git archive fits the bill: Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output. If <prefix> is specified it is prepended to the

Git-svn clone error: “fatal: Not a valid object name 'refs/remotes/tags/Tag With Spaces'”

蓝咒 提交于 2021-02-18 17:15:10
问题 I'm using git svn clone (git version 1.9.4.msysgit.0) to migrate a Subversion repository to Git. The Subversion repository has tags with spaces in it, which leads to fatal: Not a valid object name refs/remotes/tags/Tag With Spaces errors. According to various internet sources, this problem should have been fixed since Git 1.8.0, why am I still experiencing this? I also tried the marked answer from git-svn clone fails "fatal: Not a valid object name" which does not work either, it just changes

Git revert on published commits while maintaining ability to merge in future?

帅比萌擦擦* 提交于 2021-02-18 17:15:09
问题 We had two branches that existed simultaneously, like so: A--B---C--------D--H---> (Branch A) \ / \---E--F--G-/--> (Branch B) The issue is that we decided that we didn't want to merge Branch B into Branch A just yet, this was a mistake. So, we (on Branch A) reverted the merge commit: git checkout branch-a git revert H Resulting in: A--B---C--------D--H--I--> (Branch A) \ / \---E--F--G-/--> (Branch B) Which restored Branch A to its proper state. (Via the revert commit I ) We then did a bit

What are 'base' and 'head' repo in GitHub web UI?

旧街凉风 提交于 2021-02-18 15:51:26
问题 GitHub's UI is fairly unintuitive and poorly thought-out, so here's a problem and a question: What is the "head" repo? What is the "base" repo? I do not know which one is being copied from. The words "base" and "head" mean the same thing. The "head" of a linked list is similar to the "base" of a tree. (GitHub has fork tree and file tree.) "Head" and "base" are synonyms and mean the "start" of a data structure, so these labels are ambiguous. Despite the arrow in the diagram, it is not apparent

git提交到分支

心不动则不痛 提交于 2021-02-18 14:20:48
git checkout grego@gregoo:mygo$ git checkout origin/ test Note: checking out ' origin/test ' . You are in ' detached HEAD ' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using - b with the checkout command again. Example: git checkout -b < new -branch-name> HEAD is now at be427c9... Create README.md grego@gregoo:mygo$ git checkout master Switched to branch '

vscode之常用快捷键

独自空忆成欢 提交于 2021-02-18 13:42:43
原文章地址: vscode: Visual Studio Code 常用快捷键 官方快捷键说明: Key Bindings for Visual Studio Code 主命令框 F1 或 Ctrl+Shift+P : 打开命令面板。在打开的输入框内,可以输入任何命令,例如: 按一下 Backspace 会进入到 Ctrl+P 模式 在 Ctrl+P 下输入 > 可以进入 Ctrl+Shift+P 模式 在 Ctrl+P 窗口下还可以: 直接输入文件名,跳转到文件 ? 列出当前可执行的动作 ! 显示 Errors 或 Warnings ,也可以 Ctrl+Shift+M : 跳转到行数,也可以 Ctrl+G 直接进入 @ 跳转到 symbol (搜索变量或者函数),也可以 Ctrl+Shift+O 直接进入 @ 根据分类跳转 symbol ,查找属性或函数,也可以 Ctrl+Shift+O 后输入:进入 # 根据名字查找 symbol ,也可以 Ctrl+T 常用快捷键 编辑器与窗口管理 打开一个新窗口: Ctrl+Shift+N 关闭窗口: Ctrl+Shift+W 同时打开多个编辑器(查看多个文件) 新建文件 Ctrl+N 文件之间切换 Ctrl+Tab 切出一个新的编辑器(最多 3 个) Ctrl+\ ,也可以按住 Ctrl 鼠标点击 Explorer 里的文件名 左中右 3