> For the complete documentation index, see [llms.txt](https://cctang.gitbook.io/softwarecrafting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cctang.gitbook.io/softwarecrafting/tools/git.md).

# git

## Tips

* [Cloning a specific branch](http://stackoverflow.com/questions/1911109/how-to-clone-a-specific-git-branch)

## Clone using ssh-key

[For repositories on GitHub](https://stackoverflow.com/questions/6167905/git-clone-through-ssh)

```
git clone ssh://git@github.com/<user>/<repository name>.git
```

## Push to github without password using ssh-key

If it is asking you for a username and password, your origin remote is pointing at the https url rather than the ssh url.

[Change it to ssh](https://stackoverflow.com/questions/14762034/push-to-github-without-password-using-ssh-key).

For example, a github project like Git will have https url

```
https://github.com/<Username>/<Project>.git
```

and the ssh one:

```
git@github.com:<Username>/<Project>.git
```

You can do:

```
git remote set-url origin git@github.com:<Username>/<Project>.git
```

to change the url.
