Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADIOS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Podhorszki, Norbert
ADIOS2
Commits
1f555b1d
Commit
1f555b1d
authored
7 years ago
by
Atkins, Charles Vernon
Browse files
Options
Downloads
Patches
Plain Diff
Automatically detect ssh vs https when setting up remotes.
parent
8554fdd2
No related branches found
No related tags found
1 merge request
!47
Automatically detect ssh vs https when setting up remotes.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/developer/git/setup-remotes
+8
-12
8 additions, 12 deletions
scripts/developer/git/setup-remotes
with
8 additions
and
12 deletions
scripts/developer/git/setup-remotes
+
8
−
12
View file @
1f555b1d
...
@@ -17,20 +17,16 @@ then
...
@@ -17,20 +17,16 @@ then
exit
1
exit
1
fi
fi
git remote set-url origin https://github.com/
${
GH_USERNAME
}
/adios2.git
git remote set-url origin https://github.com/
${
GH_USERNAME
}
/adios2.git
read
-p
"Setup SSH push access? [(y)/n] "
GH_USE_SSH
GH_USE_SSH
=
"
${
GH_USE_SSH
,,
}
"
echo
"Testing SSH access to GitHub..."
if
[
-z
"
${
GH_USE_SSH
}
"
]
ssh
-T
git@github.com 2>/dev/null
then
if
[
$?
-eq
1
]
echo
" Empty entry. Using 'y' as default"
GH_USE_SSH
=
"y"
elif
[
"
${
GH_USE_SSH
}
"
!=
"y"
]
&&
[
"
${
GH_USE_SSH
}
"
!=
"n"
]
then
echo
" Invalid entry. Using 'y' by default"
GH_USE_SSH
=
"y"
fi
if
[
"
${
GH_USE_SSH
}
"
==
"y"
]
then
then
echo
"Success! Setting up SSH push access to your fork."
git config remote.origin.pushurl
"git@github.com:
${
GH_USERNAME
}
/adios2.git"
git config remote.origin.pushurl
"git@github.com:
${
GH_USERNAME
}
/adios2.git"
else
echo
"SSH access failed. Setting up HTTPS push access instead"
git config remote.origin.pushurl https://
${
GH_USERNAME
}
@github.com/
${
GH_USERNAME
}
/adios2.git
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment