branch

JGit: How to get all commits of a branch? (Without changes to the working directory …)

匿名 (未验证) 提交于 2019-12-03 02:26:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: how do I get all commits of a branch with JGit, without changing the working directory? Unfortunately the JGit docs are not very good ... In ruby with grit it is very easy: repo = Grit :: Repo . new ( pathToRepo ) repo . commits ( branchName , false ). each do | commit | doSomethingWithTheCommit end Bye, hurik 回答1: With the code below you can get all commits of a branch or tag : Repository repository = new FileRepository ( "/path/to/repository/.git" ); String treeName = "refs/heads/master" ; // tag or branch for ( RevCommit commit

Git: 'Master cannot be resolved to branch' after merge

匿名 (未验证) 提交于 2019-12-03 02:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Every time I merge a branch back into my master branch, I can no longer push to origin. I get the message fatal: master cannot be resolved to branch I made a simple test change: Created a new branch git branch TestBranch Made a change to TestBranch and commited Checked out back to master git checkout Master Merged TestBranch git merge TestBranch The merge seems to have gone fine, but now when I use Git status the Master branch does not tell me that it is ahead of the origin. And when I try to push to origin Master I get the message above.

IntelliJ error: branch 'origin/HEAD' does not point at a commit, some refs could not be read

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As far as I can tell everything in my git local repository is fine. I can commit, push, pull, whatever I like. However, when I view the details of a commit in the IntelliJ log, the Contained in branches: Can not load branches due to error: error: branch 'origin/HEAD' does not point at a commit error: some refs could not be read error: branch 'origin/HEAD' does not point at a commit error: some refs could not be read What could have caused this and how do I fix it? 回答1: origin/head sounds like it refers to the default branch set in your

Git: Merge to master while automatically choosing to overwrite master files with branch

匿名 (未验证) 提交于 2019-12-03 02:22:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Git to track my documentation latex source. I want to keep the master branch full of documents that are suitable for end user release, so when someone needs something, i can just switch to the master branch, compile and hand out the document. I make new branches when a manual needs a major update. But, when the manual is approved, it needs to get merged back into the master. When merging from branch into master , I would like to pass some command to Git to say, "forget the merging, just use the the file from branch to overwrite

Jenkins multi-branch pipeline and specifying upstream projects

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We currently generate a lot of Jenkins jobs on a per Git branch basis using Jenkins job DSL; the multi-branch pipeline plugin looks like an interesting way to potentially get first-class job generation support using Jenkinsfiles and reduce the amount of Job DSL we maintain. For example we have libwidget-server and widget-server develop branch projects. When the libwidget-server build finishes then the widget-server job is triggered (for the develop branch). This applies to other branches too. This makes use of the Build after other projects

smartgit delete commit and return to previous commit

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: By mistake i have made a commit that now i want to delete from the history log and return to a previous commit. I have been trying to checkout the commit that i want to return to but Smartgit ask me to create a local branch in order to do this (screen shot attached) and since im not an expert with SG i really need some advice. I have also try to revert the commit that i made by mistake but i still see the commit on the log. This is how the log look now: When trying to checkout : How my log looks at the moment : What i want to do is delete

find out when a git branch was created (not the first commit to that branch)

匿名 (未验证) 提交于 2019-12-03 02:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: how can I know when a git branch was created? i don't want to know when was the first commit to that branch. I want to find out when that branch was created. This is a script to reproduce a working example: #! /bin/bash set -x set -e mkdir test cd test git init echo "hello" >readme git add readme git commit -m "initial import" date sleep 5 git checkout -b br1 date # this is the date that I want to find out. sleep 5 echo "hello_br1" >readme git commit -a -m "hello_br1" date echo "hello_br1_b" >readme git commit -a -m "hello_br1_b" git

Why has Git allowed me to create two branches with the same name?

匿名 (未验证) 提交于 2019-12-03 02:18:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm still relatively new to Git and I have made a bit of a mess of my repository. I'm hoping there is a way to fix it without re-cloning. I have a repository which I have cloned from Github. The repository has several branches. I worked on the master branch for a while but then needed to switch to one of the other branches. So, I had: $ git branch --all * master remotes/origin/abc remotes/origin/def remotes/origin/HEAD -> origin/master remotes/origin/ghi Problem: I wanted to switch to the 'abc' branch but instead of doing git checkout

git clone with NTLM proxy hangs after resolving deltas

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I saw here many questions covering git and proxy topics but none of them solves my problem. I am cloning a git repository from Bitbucket. Everything works fine from my home network but hangs at work where we are using proxy with NTLM authentication. See the output of git clone command: $ git clone https://my_user@bitbucket.org/my_user/my_project.git --verbose Cloning into 'my_project'... Password for 'https://my_user@bitbucket.org': POST git-upload-pack (174 bytes) remote: Counting objects: 548, done. remote: Compressing objects: 100% (367

Change Default branch in gitlab

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I accidentally pushed my local master to a branch called origin on gitlab and now it is the default. Is there a way to rename this branch or set a new master branch to master? 回答1: In 8.0+ it looks like this was moved into the project. If you open your project and go to the gear icon on the right, then "Edit Project" you can set the default branch for the project. 回答2: To change the default branch in Gitlab 7.7.2: Click Settings in the left-hand bar Change the Default Branch to the desired branch Click Save Changes. 回答3: To change default