branch

git merge branches with different directory structures

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am somewhat new to git, I've been using it for a number of months, and Im comfortable doing most of the basic tasks. So... I think its time to take on some more complicated tasks. At my work, we have a few people working on older code to update it, this involves actual code work and updating the directory structure to be more modular. My question is can these two things be done in parallel branches and then merged or rebased. My intuition says no, because dir restructure is a rename, and git renames by adding a new file and deleting the

what does git merge origin/master do?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After fetching from remote using git fetch , we need to use something like git merge origin/master I would like to know if this command also does git commit at the same time? Is the order origin/master important? Can I write master/original ? 回答1: git merge origin/master can do one of two things (or error). In the first case, it creates a new commit that has two parents: the current HEAD , and the commit pointed to by the ref origin/master (unless you're doing something funny, this is likely to be (the local pointer to) the branch named

Switch branch names in git

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There may be more than one way to ask this question, so here's a desciption of the problem. I was working on master and committed some stuff and then decided I wanted to put that work on hold. I backed up a few commits and then branched from before I started my crap work. Practically this works fine, I just now have a different branch as my main development branch. I'm wondering how I could change things around so I'm working on master again but it doesn't have my junk work and said work is on a different branch. Some ways this could be

git checkout branch from outside

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Problem: I need somehow to checkout an existing branch of a project that is already cloned locally on my file system without being in that particular folder of this project. Solution: I'm trying to do the following: git clone 'github-project-url' 'file-system-folder' git checkout 'existing-branch' 'file-system-folder' I do realize that second step is not quite right, but I also am trying to avoid to "cd 'file-system-folder'". 回答1: You can use --git-dir to specify the .git directory to use as the repository, and --work-tree to specify the

Git Hub Clone All Branches At Once

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to clone an entire repository onto my machine using linux. I used git clone <url> I then went into the folder where it was downloaded and typed git branch in the terminal. It's only showing me master and not other branches which were in the remote repository. How do I clone all branches? I know that for each branch in the remote I can separately use git checkout -b <name of local branch> origin/<name of remote branch> but is there any way other than that? 回答1: (1) Inside git local repostitory, create a new sh file touch

Checkout Jenkins Pipeline Git SCM with credentials?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was following this tutorial : node { git url: 'https://github.com/joe_user/simple-maven-project-with-tests.git' ... } However it doesn't tell how to add credentials. Jenkins does have specific "Credentials" section where you define user user&pass, and then get ID for that to use in jobs, but how do I use that in Pipeline instructions? I tried with: git([url: 'git@bitbucket.org:company/repo.git', branch: 'master', credentialsId: '12345-1234-4696-af25-123455']) no luck: stderr: Host key verification failed. fatal: Could not read from remote

How to repeatedly merge branches in Mercurial

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We're using Mercurial where I work and I want to have a setup similar to how I used SVN: Trunk Tags Production Branches Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to repeatedly merge 'Trunk' with 'Production'. Quite simply, I want to have a development branch for normal work and a production branch that I routinely pull changes from the development branch into. How do I do this with Mercurial? 回答1: As the previous poster mentioned, the transplant extension can be

Git refs/remotes/origin/master does not point to a valid object

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After the last merge to the master branch of my Git repository I have lost the ability to clone repository. Cloning into test-repository... remote: Counting objects: 126084, done. remote: Compressing objects: 100% (28327/28327), done. Receiving objects: 100% (126084/126084), 132.63 MiB | 29.30 MiB/s, done. remote: Total 126084 (delta 96101), reused 126078 (delta 96095) Resolving deltas: 100% (96101/96101), done. error: refs/remotes/origin/master does not point to a valid object! error: Trying to write ref refs/heads/master with nonexistant

git pull remote branch cannot find remote ref

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm not sure why this doesn't work. When I do git branch -a , this is what I see: I'm trying to pull from the DownloadManager on the online GitHub repository. I have tried git pull, but then it complains about not knowing which branch to pull from git pull origin, doesn't know which branch git pull origin downloadmanager fatal: Couldn't find remote ref downloadmanager. Unexpected end of commands stream git pull origin remotes/origin/DownloadManager 'fatal couldn't find remote ref remotes/origin/DownloadManager. Unexpected end of commands

Hudson/Jenkins Git build all branches

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We have a lot of developers creating feature branches that I would like to build. Nightly we run a code quality tool that needs to run on every branch. I also would not like a static configuration because the number of branches changes every few weeks. 回答1: In Git configuration there is a field 'Branch Specifier (blank for default): ' if you put there ** it will build all branches from all remotes. having that you can use an environment variable ${GIT_BRANCH} e.g. to set a title for the build using https://wiki.jenkins-ci.org/display/JENKINS