I'm trying to use the git publisher to publish some changes that Jenkins made back to my repo, but getting this weird error:
Pushing HEAD to branch master at repo Android
Opening connection
Counting objects
Finding sources
Writing objects
ERROR: Failed to push branch master to Android
hudson.plugins.git.GitException: funny refname
at org.jenkinsci.plugins.gitclient.JGitAPIImpl$8.execute(JGitAPIImpl.java:1812)
at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:342)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
at hudson.model.Run.execute(Run.java:1776)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Build step 'Git Publisher' marked build as failure
Finished: FAILURE
Here are my settings:
repo name: Android
Refspec: {empty -- nothing entered here}
Branches to build: master
Checout to specific local branch: master
Git publisher:
Push only if build succeeds: true
Merge results: true
Force push: true
Branch to push: master
Target remote name: Android
Any ideas?
Additional Info
If I uncheck 'merge results', then it completes successfully, but my nothing is actually pushed to my master branch.
The issue [JENKINS-20393] Git plugin 2.0 JGit implementation does not publish merge result that contains a comment with a message like yours has been resolved "3 days ago". I guess you're not using a version that new.
Description
If I use the jgit implementation in a job which should merge from multiple branches, the merge result is not pushed back to origin. Merge result is pushed if I use the command line implementation in the same job.
Related
This all worked very smoothly up to now i.e. I have 2 years worth of git updates from this app. Everything looks fine on the AS side i.e. commit/push works fine and it says 'x files commited'. I recently checked my github page directly and to my surprise I didn't see any update for the last 2 months even though I just did 2.
AS shows this i.e. the blue checkmarks show just fine on git, but the 2 red 'x' are not showing: (what is the difference between origin/master vs. master ?)
on the git side I do see this:
when I click on the following button:
it yields a 404 page on git, the blue checkmarks are yielding correct URLs
So something broke and I'm pretty sure I'm the culprit (I had to hack around lots
of files due to very frustrating compile issue. (I spare you those details)
Now, what are my options?
Does anybody know what happened here and what files might be affected and how it can be fixed?
I would prefer not to lose the history etc. of this project and start over on Git, can I somehow 'reconnect' ?
Worst case, if I decide to restart, can I at least not touch anything on the AS side and just start something new on github (do I have to delete the repository or just rename etc.)
Hope I explained this correctly ...
P.S> showing my ignorance on git, barely got this going, so I need to refresh a bit ...
I see a 'branch', but it only shows 'master':
also when I click on the branch icon, it shows this, not sure if that helps, but thanks for the pointer, will check more tomorrow
2nd PS: git status shows:
C:\Users\roberts\AndroidStudioProjects\LingoFlash>git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .idea/caches/build_file_checksums.ser
modified: .idea/misc.xml
Untracked files:
(use "git add <file>..." to include in what will be committed)
.idea/caches/gradle_models.ser
no changes added to commit (use "git add" and/or "git commit -a")
and then this !!!
C:\Users\roberts\AndroidStudioProjects\LingoFlash>git push
fatal: AggregateException encountered.
One or more errors occurred.
Username ---
Password ---
Counting objects: 46, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (37/37), done.
Writing objects: 100% (46/46), 6.21 KiB | 0 bytes/s, done.
Total 46 (delta 30), reused 0 (delta 0)
remote: Resolving deltas: 100% (30/30), completed with 21 local objects.
To https://github.com/---
eb29877..ff09500 master -> master
it seems to have fixed the issue and flushed the 'pipe', thanks so much !
what is the difference between origin/master vs. master ?
origin/master records the last time the remote repository branch master was updated (through push or fetch)
master is a local branch, which does not seem to have been pushed (or origin/master would have been updated to that same commit)
You can try and switch to a command-line session, checking out the output of git status, and git push.
First of all , i am very beginner in this drone and docker stuffs , so please be kind on me. Now this is the scenario
My organisation has a drone server ready and working.
When I log in into the drone server , I can see all my android repositories.
There is repository named "DockerTesting" which I have made just to set up the drone for Android build.(It might confuse you)
I have added an .drone.yml file in top-level repository "DockerTesting"
My .drone.yml looks like this
image: docker.vokalinteractive.com/android:latest
env:
- ORG_GRADLE_PROJECT_ratsUser={{rats_user}}
- ORG_GRADLE_PROJECT_ratsPass={{rats_pass}}
- ANDROID_HOME=/usr/local/android-sdk
script:
- ./gradlew build device
notify:
slack:
webhook_url: https://hooks.slack.com/services/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
channel: docker_android
username: drone
template: >
{{#success build.status}}
{{ build.author }} successfully pushed to {{ build.branch}}. Code was published.
{{else}}
{{ build.author }} broke the build. Code was not published.
<{{system.link_url}}/{{repo.full_name}}/{{build.number}}|{{repo.name}}#{{build.commit}}>
{{/success}}
I wrote this yml file myself using google
I am getting slack notification this is good at least for me
Below is the problem:
In the repository "Docker Testing" I made a syntax error, as a result the build was failed in my local machine(my laptop) in Android Studio.
Now I did git push command to update this repository in my company's server
3 The push was successful (Why?) . It should have failed as I have done a syntax error & also the build was failed in local machine
I read this but that did not explain Branch default. It would be nice to have a short explanation for all in one post.
thank you
Merge: The result is identical with that of running git fetch ; git merge or git pull.
Rebase: The result is identical with that of running git fetch ; git rebase or git pull --rebase.
Branch Default: This option is to choose the default command for the branch applied. The default command is specified in the branch.<name> section of the .git/config configuration file.
Example:
Assume the following history exists
A---B---C topic
/
D---E---F---G master
Merge:
If the current branch is "master"
Then "git merge topic" will replay the changes made on the topic branch since it diverged from master.Then the result of the following command:
git merge topic
would be:
A---B---C topic
/ \
D---E---F---G---H master
Rebase:
If the current branch is "topic"
Then the commits that were in the "topic" branch are reapplied to the current branch, one by one, in order.
Then the result of either of the following commands:
git rebase master or
git rebase master topic
would be:
A'--B'--C' topic
/
D---E---F---G master
For further reference please refer the links below:
1.https://git-scm.com/docs/git-merge
2.https://git-scm.com/docs/git-rebase
3.https://www.jetbrains.com/idea/help/update-project-dialog-git.html?search=update%20projec
I am completely new to Github...
I have been learning Android from udacity and I cloned one of the forks from the public repository.
Now, I want to create my own private repository and push the files to it but it always tries to push them to the udacity repository instead of mine.
Here are the commands I used:
git remote add origin <my_git_url>
git add .
git commit -m "First Commit"
git push origin master
But it just keeps returning this:
remote: Permission to udacity/Sunshine-Version-2.git denied to xxxx.
fatal: unable to access 'https://github.com/udacity/Sunshine-Version-2.git/': The requested URL returned error: 403
Please help....
The error says you don't have rights to push there.
Most probably, you have to fix your repository url.
git remote remove origin
git remote add origin https://github.com/your-username/your-repository
git push origin master
Then it will ask you to provide the credentials. Later you can get rid of that using SSH urls. Here is a nice article on how to get started using SSH keys.
i.e. If I have done:
$ repo init -b froyo; repo sync
and I come back to this repo later, how can I determine which the version checked out is?
In other words, the response to:
$ "unknown command which I am looking for"
should be "froyo" in this case (or the respective version number),
after:
$ repo init -b gingerbread; repo sync
it should be "gingerbread" (or the respective version number)
You can open a manifest.xml file in your .repo hidden directory.
In the file you can find the following tag and value for gingerbread:
default revision="refs/tags/android-2.3.4_r1"
I do not know if it is an official way to do this.
manifests.git
Repo just downloads a given version of a git repository containing manifest files.
That repository is stored inside .repo, so you can check out its version with:
git --git-dir .repo/manifests.git log default
which shows me on the first line:
commit 985cbc6c03245ae454491a062a54afe9e7732d1e (tag: android-7.1.1_r6, origin/android-7.1.1_r6, m/android-7.1.1_r6, default)
Get the SHA of all repos
This command might also be useful, since branches appear to be moving and not sync all the subrepos:
repover() (
# Print the revision of all repos.
top="$(pwd)/"
repo forall -c "pwd=\"\$(pwd)\"; echo \"\$(git log -1 --format=\"%H\") \${pwd#$top}\""
)
The output is of form:
c3e60f38c81a3dd4ff49dca0f05f84a8b464004f art
293d4633af7d80584c7968c650bced857f338bc0 bionic
80ccac2fffc09ef0b8a1fe43c096788e12359a1d bootable/recovery
3aaf722a8d25ed726d4aba5d96bd325afe74a61c build/blueprint
cfcaaa25117310666e02a989a6bd9d45e82d8041 build/kati
a7229a08b7c5d481cb813d810f1d88c3de3cdc8b build/make
2e020842dc44bb67c3aad84217b3e6c4fa8fd900 build/soong
4cc6ccbeeed7d8ddcfb0fc955e523ba6d86e9601 compatibility/cdd
34c43035d43004a23d34b1ae6651f6ea2107eb4c cts
dd452a4244dad07c53db525d314fdcf4429ffd46 dalvik