-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmovetogit.yml
More file actions
82 lines (70 loc) · 2.19 KB
/
movetogit.yml
File metadata and controls
82 lines (70 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
trigger:
- none
pool:
vmImage: 'windows-latest'
resources:
repositories:
- repository: githubRepo
type: github
name: LaylaLiu-gmail/layliunode14git
endpoint: github.com_LaylaLiu-gmail
variables:
ref: $[ resources.repositories.githubRepo.ref ]
name: $[ resources.repositories.githubRepo.name ]
id: $[ resources.repositories.githubRepo.id ]
type: $[ resources.repositories.githubRepo.type ]
url: $[ resources.repositories.githubRepo.url ]
version: $[ resources.repositories.githubRepo.version ]
steps:
- bash: |
echo "name = $(name)"
echo "ref = $(ref)"
echo "id = $(id)"
echo "type = $(type)"
echo "url = $(url)"
echo "version = $(version)"
git config --global user.name
git config --global user.email 'azure-devops@devops.com'
displayName: 'Set up Git'
- checkout: githubRepo
persistCredentials: true
- bash: |
cd layliunode14git
dir
echo local
git config -l
token=$(git config -l | grep 'LaylaLiu-gmail/layliunode14git.extraheader=AUTHORIZATION:' | awk -F':' '{print $3}' | awk '{print $2}' | base64 -d | awk -F':' '{print $2}')
echo token
echo $token
echo global
git config --global -l
haa=$(git config --get http.https://github.com/LaylaLiu-gmail/layliunode14git.extraheader)
echo $haa
git config --global http.https://github.com/LaylaLiu-gmail/layliunode14git.extraheader "$haa"
- checkout: self
persistCredentials: true
- script: |
cd Samples
echo "global2"
git config --global -l
echo "local2"
git config -l
echo $(url)
git remote add github $(url)
git remote -v
git push github --tags "refs/remotes/origin/*:refs/heads/*" -f
displayName: 'Push to GitHub'
env:
GIT_ASKPASS: echo
# - script: |
# git config --global user.name 'azure-devops'
# git config --global user.email 'azure-devops@devops.com'
# cd $(Build.SourcesDirectory)
# git log
# git remote add github https://$(GITHUB_TOKEN)@github.com/LaylaLiu-gmail/layliunode14git.git
# git remote -v
# git push github --tags "refs/remotes/origin/*:refs/heads/*"
# git branch --all
# git push github --tags
# git branch --all
# displayName: 'Push to GitHub'