Skip to content

camilasbraz/using-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

using-github

Windows

First steps

Based on this website

  1. Download and intall git: Available here

  2. Create a new folder, right click on it and choose 'Git bash here'

  3. Configure your user name and email

git config --global user.name username
git config --global user.email email
  1. Initialize git with
git init
  1. Testing commits
touch test.txt
git add .
git commit -m "First commit"
  1. Link the ssh key to your email
ssh-keygen -t rsa -C email

Press enter or choose in which folder you wish to save the ssh key and set (or not) a passphrase

  1. Go to your github settings and then to SSH and GPG Keys. Click on New SSH Key, give it a title and pass the key you just created on the above step. It can be found using the notepad ~/.ssh/id_rsa.pub command on bash.

  2. Go back to git Bash and type

image

Choose yes then type your password. If everything works out fine, the message "You've successfully authenticated, but GitHub does not provide shell access. " will appear
  1. To clone a repository in your local machine, click on Code --> SSH and copy the link

image

  1. Then, git bash on tha folder you want to clone the repository to and type
git remote add origin [email protected]:user/repo_name.git

change user and repo_name!

Basic commands

  1. Update the folder in your computer
git push
  1. Commit and pull
git add . 
git commit -m 'comment'
git pull origin branch_name
  1. Change branch
git checkout <existing_branch>
git checkout -b <new_branch> (if branch does not exist)

SmartGit

Download

Erro: fatal: remote origin already exists.

run git push -u origin master on terminal or

git remote rm origin
git remote add origin https://github.com/USERNAME/REPOSITORY.git

Create a remote repo from a local folder:

Follow these steps

 git init
 gh repo create <repo name> --public --source=. --remote=upstream

Git Hub tutorial

git add .
git commit -m 'm'
git branch -M main
git remote add origin [email protected]:user/repo_name.git
git push origin main

Releases

No releases published

Packages

No packages published