Git Polling Log java.io.IOException: error=2, No such file or director

rajeshkumar created the topic: Git Polling Log java.io.IOException: error=2, No such file or director
Error
Started on Sep 15, 2015 9:57:00 AM
Using strategy: Default
[poll] Last Built Revision: Revision 2c06c1d705f61e2654d7f30131d8205d6b755d09 (refs/remotes/origin/master)
> /mnt/jenkins/git/2.3.1/bin/git –version # timeout=10
> /mnt/jenkins/git/2.3.1/bin/git ls-remote -h server.com/repo-provisioning.git master # timeout=10
FATAL: hudson.plugins.git.GitException: Error performing command: /mnt/jenkins/git/2.3.1/bin/git ls-remote -h replica.int.devsnc.com/devsnc-provisioning.git master
hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: /mnt/jenkins/git/2.3.1/bin/git ls-remote -h http://server/repo-provisioning.git master
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:527)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:384)
at hudson.scm.SCM.poll(SCM.java:401)
at hudson.model.AbstractProject._poll(AbstractProject.java:1433)
at hudson.model.AbstractProject.poll(AbstractProject.java:1336)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:515)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:544)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: hudson.plugins.git.GitException: Error performing command: /mnt/jenkins/git/2.3.1/bin/git ls-remote -h http://server/repo-provisioning.git master
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1464)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1245)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1143)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1134)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2139)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:576)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:525)
… 13 more
Caused by: java.io.IOException: Cannot run program “/mnt/jenkins/git/2.3.1/bin/git”: java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
at hudson.Proc$LocalProc.(Proc.java:244)
at hudson.Proc$LocalProc.(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1453)
… 19 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
… 24 more
Done. Took 21 ms
No changes

Solution –
A work around of adding the “Force polling using workspace” as an “Additional behaviour” in your git SCM definition of the windows job.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Git Polling Log java.io.IOException: error=2, No such file or director

rajeshkumar created the topic: Git Polling Log java.io.IOException: error=2, No such file or director
Error
Started on Sep 15, 2015 9:57:00 AM
Using strategy: Default
[poll] Last Built Revision: Revision 2c06c1d705f61e2654d7f30131d8205d6b755d09 (refs/remotes/origin/master)
> /mnt/jenkins/git/2.3.1/bin/git –version # timeout=10
> /mnt/jenkins/git/2.3.1/bin/git ls-remote -h server.com/repo-provisioning.git master # timeout=10
FATAL: hudson.plugins.git.GitException: Error performing command: /mnt/jenkins/git/2.3.1/bin/git ls-remote -h replica.int.devsnc.com/devsnc-provisioning.git master
hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: /mnt/jenkins/git/2.3.1/bin/git ls-remote -h http://server/repo-provisioning.git master
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:527)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:384)
at hudson.scm.SCM.poll(SCM.java:401)
at hudson.model.AbstractProject._poll(AbstractProject.java:1433)
at hudson.model.AbstractProject.poll(AbstractProject.java:1336)
at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:515)
at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:544)
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: hudson.plugins.git.GitException: Error performing command: /mnt/jenkins/git/2.3.1/bin/git ls-remote -h http://server/repo-provisioning.git master
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1464)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1245)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1143)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1134)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2139)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:576)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:525)
… 13 more
Caused by: java.io.IOException: Cannot run program “/mnt/jenkins/git/2.3.1/bin/git”: java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
at hudson.Proc$LocalProc.(Proc.java:244)
at hudson.Proc$LocalProc.(Proc.java:216)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
at hudson.Launcher$ProcStarter.start(Launcher.java:381)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1453)
… 19 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
… 24 more
Done. Took 21 ms
No changes

Solution –
A work around of adding the “Force polling using workspace” as an “Additional behaviour” in your git SCM definition of the windows job.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Good GIT SCM Video at youtube.

rajeshkumar created the topic: Good GIT SCM Video at youtube.
Hi Friends,

This week I am started digging more into to GIT. I hope these videos will be helpful for you as well.

Introduction to Git

Linus Torvalds on git

O’Reilly Webcast: Git in One Hour

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Good PPT slides for GIT on slideshare.net

rajeshkumar created the topic: Good PPT slides for GIT on slideshare.net
Must be referenced.

www.slideshare.net/JamesEdwardGrayII/git-and-github-3675432
www.slideshare.net/terrywang/git-101-tutorial-presentation/
www.slideshare.net/railsconf/smacking-gi…advanced-git-tricks/

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Useful website Reference for GIT

rajeshkumar created the topic: Useful website Reference for GIT
Here are following website good to know more about GIT-SCM.

help.github.com/
progit.org/
git-scm.com/
whygitisbetterthanx.com/

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Why GIT differnece than another SCM?

rajeshkumar created the topic: Why GIT differnece than another SCM?
Why GIT differnece than another SCM?
Cheap Local Branching
Everything is Local
Git is Fast
Git is Small
The Staging Area
Distributed
Any Workflow
Easy to Learn
Git is the new standard
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Git Reset Vs Git Revert

rajeshkumar created the topic: git reset Vs git revert
git reset Vs git revert

The git revert command undoes a committed snapshot. But, instead of removing the commit from the project history, it figures out how to undo the changes introduced by the commit and appends a new commit with the resulting content. This prevents Git from losing history, which is important for the integrity of your revision history and for reliable collaboration.

git revert

Reverting vs. Resetting
It’s important to understand that git revert undoes a single commit—it does not “revert” back to the previous state of a project by removing all subsequent commits. In Git, this is actually called a reset, not a revert.\

Reverting has two important advantages over resetting. First, it doesn’t change the project history, which makes it a “safe” operation for commits that have already been published to a shared repository. For details about why altering shared history is dangerous, please see the git reset page.

Second, git revert is able to target an individual commit at an arbitrary point in the history, whereas git reset can only work backwards from the current commit. For example, if you wanted to undo an old commit with git reset, you would have to remove all of the commits that occurred after the target commit, remove it, then re-commit all of the subsequent commits. Needless to say, this is not an elegant undo solution.

git reset

If git revert is a “safe” way to undo changes, you can think of git reset as the dangerous method. When you undo with git reset(and the commits are no longer referenced by any ref or the reflog), there is no way to retrieve the original copy—it is a permanent undo. Care must be taken when using this tool, as it’s one of the only Git commands that has the potential to lose your work.

Usage

git reset

Remove the specified file from the staging area, but leave the working directory unchanged. This unstages a file without overwriting any changes.

git reset

Reset the staging area to match the most recent commit, but leave the working directory unchanged. This unstages all files without overwriting any changes, giving you the opportunity to re-build the staged snapshot from scratch.

git reset –hard

Reset the staging area and the working directory to match the most recent commit. In addition to unstaging changes, the –hard flag tells Git to overwrite all changes in the working directory, too. Put another way: this obliterates all uncommitted changes, so make sure you really want to throw away your local developments before using it.

git reset

Move the current branch tip backward to , reset the staging area to match, but leave the working directory alone. All changes made since will reside in the working directory, which lets you re-commit the project history using cleaner, more atomic snapshots.

git reset –hard

Move the current branch tip backward to and reset both the staging area and the working directory to match. This obliterates not only the uncommitted changes, but all commits after , as well.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: git reset Vs git revert
More Reference —

www.atlassian.com/git/tutorial/undoing-changes#!revert
www.atlassian.com/git/tutorial/undoing-changes#!reset
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

How to clean workspace in git?

rajeshkumar created the topic: How to clean workspace in git?
To reset a specific file to the last-committed state (to discard uncommitted changes in a specific file):

git checkout thefiletoreset.txt

This is mentioned in the git status output:

(use “git checkout — …” to discard changes in working directory)

To reset the entire repository to the last committed state:

git reset –hard

To remove untracked files, I usually just delete all files in the working copy (but not the .git/ folder!), then do git reset –hard which leaves it with only committed files.

A better way is to use git clean:

git clean -d -x -f

will remove untracked files, including directories (-d) and files ignored by git (-x). Replace the -f argument with -n to perform a dry-run or -i for interactive mode and it will tell you what will be removed.
you delete local files from your current branch?

git clean -f

But beware… there’s no going back. Use -n or –dry-run to preview the damage you’ll do.

If you want to also remove directories, run git clean -f -d

If you just want to remove ignored files, run git clean -f -X

If you want to remove ignored as well as non-ignored files, run git clean -f -x

Note the case difference on the X for the two latter commands.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Customizing Git – Git Hooks

rajeshkumar created the topic: Customizing Git – Git Hooks
Like many other Version Control Systems, Git has a way to fire off custom scripts when certain important actions occur. There are two groups of these hooks: client side and server side. The client-side hooks are for client operations such as committing and merging. The server-side hooks are for Git server operations such as receiving pushed commits. You can use these hooks for all sorts of reasons, and you’ll learn about a few of them here.

Installing a Hook

The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that’s .git/hooks. By default, Git populates this directory with a bunch of example scripts, many of which are useful by themselves; but they also document the input values of each script. All the examples are written as shell scripts, with some Perl thrown in, but any properly named executable scripts will work fine — you can write them in Ruby or Python or what have you. These example hook files end with .sample; you’ll need to rename them.

To enable a hook script, put a file in the hooks subdirectory of your Git directory that is named appropriately and is executable. From that point forward, it should be called. I’ll cover most of the major hook filenames here.

Client-Side Hooks

There are a lot of client-side hooks. This section splits them into committing-workflow hooks, e-mail-workflow scripts, and the rest of the client-side scripts
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :