Commit History in azure pipelines not working

Viewed 38

Im trying to get commit history in azure pipelines, this is in order to revert last commit, but when I run "git log" just show last commit, if I make the revert for last commit everything gets deleted. this is the job:

- script: |
    git config --global user.email "--------"
    git config --global user.name "--------"
    ls

- checkout: self
  # fetchDepth: 1
  persistCredentials: true
  clean: true

- script: |
    # git revert --no-edit HEAD
    # git push origin HEAD:main
  displayName: GitRevert

main branch is called "main", this is the result of checkout task

Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Syncing repository: orgname/PoC_Linear_workflow (GitHubEnterprise)
git version
git version 2.37.3
git lfs version
git-lfs/3.2.0 (GitHub; linux amd64; go 1.18.2)
git init "/home/vsts/work/1/s"
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /home/vsts/work/1/s/.git/
git remote add origin https://repoUrl/orgname/PoC_Linear_workflow
git config gc.auto 0
git config --get-all http.https://repoUrl/orgname/PoC_Linear_workflow.extraheader
git config --get-all http.extraheader
git config --get-regexp .*extraheader
git config --get-all http.proxy
git config http.version HTTP/1.1
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin --depth=1 +1e81448684a4a5a5adcf3e916c100f2c5acb6f95:refs/remotes/origin/1e81448684a4a5a5adcf3e916c100f2c5acb6f95
remote: Enumerating objects: 11, done.        
remote: Counting objects:   9% (1/11)        
remote: Counting objects:  18% (2/11)        
remote: Counting objects:  27% (3/11)        
remote: Counting objects:  36% (4/11)        
remote: Counting objects:  45% (5/11)        
remote: Counting objects:  54% (6/11)        
remote: Counting objects:  54% (6/11)        
remote: Counting objects:  63% (7/11)        
remote: Counting objects:  72% (8/11)        
remote: Counting objects:  81% (9/11)        
remote: Counting objects:  90% (10/11)        
remote: Counting objects: 100% (11/11)        
remote: Counting objects: 100% (11/11), done.        
remote: Compressing objects:  10% (1/10)        
remote: Compressing objects:  20% (2/10)        
remote: Compressing objects:  30% (3/10)        
remote: Compressing objects:  40% (4/10)        
remote: Compressing objects:  50% (5/10)        
remote: Compressing objects:  60% (6/10)        
remote: Compressing objects:  70% (7/10)        
remote: Compressing objects:  80% (8/10)        
remote: Compressing objects:  90% (9/10)        
remote: Compressing objects: 100% (10/10)        
remote: Compressing objects: 100% (10/10), done.        
remote: Total 11 (delta 1), reused 8 (delta 0), pack-reused 0        
From https://repoUrl/orgname/PoC_Linear_workflow
 * [new ref]         1e81448684a4a5a5adcf3e916c100f2c5acb6f95 -> origin/1e81448684a4a5a5adcf3e916c100f2c5acb6f95
git --config-env=http.extraheader=env_var_http.extraheader fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin --depth=1 +1e81448684a4a5a5adcf3e916c100f2c5acb6f95
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
From https://repoUrl/orgname/PoC_Linear_workflow
 * branch            1e81448684a4a5a5adcf3e916c100f2c5acb6f95 -> FETCH_HEAD
git checkout --progress --force refs/remotes/origin/1e81448684a4a5a5adcf3e916c100f2c5acb6f95
Note: switching to 'refs/remotes/origin/1e81448684a4a5a5adcf3e916c100f2c5acb6f95'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 1e81448 add more looogs
git config http.https://repoUrl/orgname/PoC_Linear_workflow.extraheader "AUTHORIZATION: placeholder_f171fa63-2d5b-4817-87f5-4eee68ee19fb"
Finishing: Checkout orgname/PoC_Linear_workflow@main to s       

Any Idea how to get all commit history there? thanks a lot

0 Answers
Related