How to clone/edit/push a GitHub Gist

We can’t add any collaborators to a GitHub Gist.


We can clone a gist with HTTPS clone URL with a username provided.

$ git clone https://<username><id>.git
Cloning into '<id>'...
remote: Counting objects: ..., done.
remote: Compressing objects: 100% (.../...), done.
remote: Total ... (delta ...), reused ... (delta ...), pack-reused ...
Unpacking objects: 100% (.../...), done.
Checking connectivity... done.
$ cd <id>
$ git remote show origin
* remote origin
  Fetch URL: https://<username><id>.git
  Push  URL: https://<username><id>.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

Now we can make changes to our files.


And git might ask for your password when we push commits back to the remote.

$ git push
Password for 'https://<username>': <password>
Counting objects: ..., done.
Delta compression using up to ... threads.
Compressing objects: 100% (.../...), done.
Writing objects: 100% (.../...), ... bytes | ... bytes/s, done.
Total ... (delta ...), reused ... (delta ...)
To https://<username><id>.git
   xxxxxxx..xxxxxxx  master -> master

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s