git

Git: local branchs tracks other local branch

喜夏-厌秋 提交于 2021-02-08 06:07:57
问题 I know that local branches can track remote branches, but there is also the possibility that a local branch tracks another local branch. What is a use-case for this? 回答1: Real-world use: I have an upstream repository, and a local branch tracking that remote. I start working on a major "feature" which will require a mess of changes to implement, but I don't yet want to expose the work upstream (potentially, ever). So I create a local branch tracking my tracking branch. Now I have origin/master

what gets “cloned” and “pushed” during git clone and git push

爷,独闯天下 提交于 2021-02-08 05:58:15
问题 When I run a command such as git push or git push origin master and my repo looks like B--C--D <- master / A--E--F <- foo-branch and origin just looks like A <- master does push include commits E and F? I understand that typcially it does not include foo-branch , but do all commits still get pushed? Likewise, when i do git clone <some-remote-repo> I know I typically get one branch (seems to be usually master ), but do I also have local copies of commits for for other branches, even if I don't

浅析 Git 子模块

时光怂恿深爱的人放手 提交于 2021-02-08 05:45:59
I. 何为 Git 子模块? 1.1 - 现状和问题 以前端项目为例,通常我们用 npm dependencies 来集成第三方库,或者将自己维护的多个项目中通用的组件抽取出来。 "devDependencies": { "babel-eslint": "^8.2.3", "base64-img": "^1.0.3", "body-parser": "^1.17.2", "colors": "^1.3.0", "eslint": "^4.19.1", "eslint-plugin-babel": "^5.1.0", "express": "^4.15.3", "fs-extra": "^3.0.1", "fs-watch-tree": "^0.2.5", "klaw-sync": "^2.1.0", "less": "^2.7.2", "lodash": "^4.17.4", "node-file-eval": "^1.0.0", "nodemon": "^1.11.0", "postcss": "^6.0.5", "precommit-hook": "^3.0.0", "ws": "^5.1.1" } 这种方式简单方便、支持广泛,适用于大部分情况;但是对于其中某些库来说,也存在一些 痛点 : 需要第三方库编译打包完成,并发布到 npm 如果第三方库有多个编译选项

What if I want to use files in gitignore

ε祈祈猫儿з 提交于 2021-02-08 05:45:43
问题 For sensitive data such as aws keys or password, I put them to files which is in .gitignore to make sure it is not committed to git. However, when keys are going to be used when scripts are running, what should I do? Manually add key content in a file before running? What if the program need to be triggered periodically by Jenkins? Can anyone help me with this? 回答1: Manually add key content in a file before running? That is the general idea: sensitive information should not be in a Git repo,

Jenkins: Git push will trigger a Jenkins build for only that branch

て烟熏妆下的殇ゞ 提交于 2021-02-08 05:43:22
问题 We are working in parallel on a number of Git branches. When pushing a specific Git branch, how can we start a Jenkins item/job that will trigger the build of that specific branch? As an example: we push a Git branch "feature-abc" ==> this should trigger a Jenkins build job using/pulling that branch "feature-abc". For each new feature we have a branch, so the number of branches is not fixed. So, I think it is different than this answer with a manual action. 回答1: If the use case is to trigger

Can a git repository be created where branches are clones from other repositories?

ⅰ亾dé卋堺 提交于 2021-02-08 05:41:54
问题 Here is the situation: I have inherited two separate machines, one used for "development" the other is the production machine. The problem: They are of course out of sync. In order to bring some sanity to situation I made independent git repositories of the application directory on each machine. I now wish to be able to compare those repos so I can find out what is different between them. My idea was to make a third repository that contained two branches, one from the repository of the "dev"

Protect Azure Pipeline Yaml File from Being Edited

人走茶凉 提交于 2021-02-08 05:36:26
问题 Currently storing our pipeline YAML files in our git repo in Azure Devops - trying to find a way to restrict certain users from editting/accessing the YAML file or even possibly a folder that contains the YAML file. We want to implement additional security to prevent our developers from modifying our YAML files to potential exploit sensitive information or make changes that we don't approve (We have a PR policy in place, but would like additional security measures). Ideally - we could setup a

How to use Submodules with EGit

不羁岁月 提交于 2021-02-08 05:21:55
问题 The Eclipse Team Provider for Git works but i do not see any changes for submodules when I use synchronize. I see changes with the diff on the command line and also with tortoise i see the changes. So, does anyone know ho to use Git and Eclipse in a way that synchronize and commit works with submodules? 回答1: The "Working with Submodules" section shows the submodules in the Git Repositories view: From there, you have access to two actions: Selecting the Update Submodule action on a submodule

Is it possible in git to push commits one by one instead of all of them at once?

一世执手 提交于 2021-02-08 05:17:48
问题 I'm using a really unreliable connection and while I try to stage commits so none of them is over 20mb and/or to push them once they reach a size like that, sometimes it's not possible (a few of the assets can be big - I know it's not the best idea to use git for assets too) and there are 90% of chances my connection will fail before everything is sent. Is it possible to push commits one by one, or can you suggest any other tips that could be useful for this case? 回答1: Yes, it's not only

Git submodule update slow on Windows

杀马特。学长 韩版系。学妹 提交于 2021-02-08 04:59:30
问题 Git submodule seems to be extremely slow on Windows. To test the performance I created 3 bare repos and committed 3 independent messages to them (no files stored). I then added each of these bare repos as submodules in a new git repo and performed a submodule update and it took over 5 seconds. This seems excessive and very noticeable when using 20+ submodules. What could be causing it to take so long? Example files: https://drive.google.com/file/d/1n6fAm16tXtt_1YvXbPHhn150iuw-VGOk/view Run