DevOps Commune

DevOps Commune

Hot

Post Top Ad

Post Top Ad

Thursday, October 5, 2017

TFS git Gated Build checkout failed ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job

October 05, 2017 0
I was a strange issue some times back when tried to build a jenkins job which checkouts the code based on the pull request commit ID.



For a TFS Git Gated Build it always required to checkout code based on the commit ID of pull request raised. But when i tried to check out code in jenkins using git plugin, got the error saying "Couldn't find any revision to build. Verify the repository and branch configuration for this job". But the provided commit ID was valid one ! At the same time it works fine for a different Commit ID. Only for Pull Request Commit ID it wasn't working !!

This issue can be fixed by mentioning th refspec in git plugin settings in jenkins job.

+refs/pull/*:refs/remotes/origin/pr/*



Read More

TFS GIT clone failed after upgrade to 2017 : Git Commands Return Fatal: Authentication Failed

October 05, 2017 0

Facing "Fatal: Authentication Failed" error while cloning a tfs git repository even if you are provided with enough permissions ? 



Which version of TFS you are using ? Is it 2017 ? 

You need git version 2.9 or later to work with TFS Git for TFS version 2017+ . 

Check your git version with command git --version and upgrade if you have git 2.9 or older.

You are Done . Happy Cloning !!!
Read More

git clean : Remove untracked files from the working tree

October 05, 2017 0
Let's Explore the git clean command here. git clean Removes all un-tracked files from the working tree


Step 1 is to show what will be deleted by using the -n option:

git clean -n
Clean Step - beware: this will delete files:

git clean -f
To remove directories, run git clean -f -d or git clean -fd
To remove ignored files, run git clean -f -X or git clean -fX
To remove ignored and non-ignored files, run git clean -f -x or git clean -fx
Note the case difference on the X for the two latter commands.

If clean.requireForce is set to "true" (the default) in your configuration, one needs to specify -f otherwise nothing will actually happen.

Again see the git-clean docs for more information.

Options

-f

--force

If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to run unless given -f, -n or -i.

-x

Don’t use the standard ignore rules read from .gitignore (per directory) and $GIT_DIR/info/exclude, but do still use the ignore rules given with -e options. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build.

-X

Remove only files ignored by Git. This may be useful to rebuild everything from scratch, but keep manually created files.

-n

--dry-run

Don’t actually remove anything, just show what would be done.

-d

Remove untracked directories in addition to untracked files. If an untracked directory is managed by a different Git repository, it is not removed by default. Use -f option twice if you really want to remove such a directory.


Refer Official git Documentation for deep learning
Read More

How to reduce checkout time in Jenkins git Plugin

October 05, 2017 0
Taking too much time to checkout/Clone/Fetch the source code from repo in Jenkins with Git Plugin ?



 Here is a workaround for you. Never Delete you workspace/Wipe out the local repo before cloning the source code from remote repository. Run the below commands as first build step in your Jenkins job [ Execute Shell script or Batch Script ].
cd $WORKSPACE
git clean -df
git checkout -- *
It Clears the all local changes which is not tracked by your Git repo and checkout only the latest changes from remote repo.

Learn more about git clean refer this article: 
http://devopscommune.blogspot.in/2017/10/git-clean-remove-untracked-files-from.html
Read More

Post Top Ad