file:test.sh
#! /bin/sh
echo '$#' $#
echo '$@' $@
echo '$?' $?
*If you run the above script as*
To do so, specify the -r (or --recursive) option:
$ cp -r ../.git .
zip -r folder1 folder1 -x exclude1 exclude2 |
#!/bin/sh -e | |
# Usage: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > COPYING | |
#!/bin/sh | |
echo "Copyright (c) `date +%Y` Albert Park | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the |
After enabling two-factor authentication on my GitHub account it seemed I became unable to push my local repositories from command-line git using the https transport.
I was simply wrong, here what I did to fix the issue.
Two-factor authentication in GitHub works by replacing your GitHub password with a Personal Access Token which can be different depending on the application you want to enable.
Before you start, make sure you know:
- Your GitHub username
- The clone URL for the external repository, such as
https://external-host.com/user/repo.git
orgit://external-host.com/user/repo.git
(perhaps with auser@
in front of theexternal-host.com
domain name)
For purposes of demonstration, we'll use:
- An external account named extuser
- An external Git host named
https://external-host.com
This guide all started because of the infamous Permission Denied (publickey)
when trying to push code to my repository. Before we can start using repositories intensively there are prequisties that we must complete in order to get our work flowing.
We will be using git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. You can also use the default Windows Command Prompt by installing git from git-scm.
Tip: You can use any *nix
based command prompt
First thing is first, we must first identify if the ssh-agent
is enabled and running properly. If this is not an issue go to step 2.