Skip to content

animalito/github_tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github_tutorial

Mini tutorial emphasizing uses in multidisciplinary projects! Git/github is not just for coders!

*If you also love git and are trying to get your team to use it, feel free to contribute!

Installation

Windows

The first and most important thing you have to ask yourself is: Why, why, why am I still in Windows?

The second thing to ask yourself is: Why do I keep doing this to myself?

If you choose not to hear this advice, here's what you gotta do to have git on Windows.

Linux

###Fedora

$ yum install git-core

###Debian

$ apt-get install git

Mac

Hahaha you spent a LOT of money! Don't be so fresa.

Did you see how easy it was for Linux users? There are two ways for you:

  1. Via the git installer
  2. With MacPorts installed:
$ sudo port install git-core +svn +doc +bash_completion +gitweb

The basic global setup

Git (or github) is, in my opinion, a pretty awesome way to work in teams because it facilitates sharing and integrating work and it makes everyone accountable for the tasks that are assigned to them.

For the second reason, you have to tell github who you are:

$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"

Once you do this, everything that you upload/update/do will have your name attached in the history of your repo (accountability FTW!)

One last thing...

If on a Mac also add:

$ git config --global core.autocrlf input
$ git config --global core.safecrlf true

If on Windows also add:

$ git config --global core.autocrlf true
$ git config --global core.safecrlf true

This will setup line ending preferences.

Pimping it up some mo'!

You can also tell git which editor you prefer (obviously, my example is with emacs but you plug in your favourite!)

$ git config --global core.editor emacs

Lastly, for resolving merge conflicts, you can setup where you want to do it!

$ git config --global merge.tool emerge

Let's check out our setup:

$ git config --list

More info on setup.

Getting help

No one (and I mean no one) knows everything. Knowing how to access the documentation is always your best bet.

To access git's manpage just do:

$ git help <verb>
$ git <verb> --help
$ man git-<verb>

where refers to any command you want! (If you know not any command, ask Google what you wanna do and start checking out all the possibilities to make your life easier!)

Handling credentials

You obviously do not want to add your credentials every single time you want to clone, pull or push from a repo in github.

ssh

My prefered choice, is via ssh. You just have to follow the appropiate instructions for you operating system in here and you will never again worry about inputing your credentials. It is the safest way to connect your local versions of the repos with github.

Once your credentials are configured, be sure to clone the repositories using the appropiate ssh connector, that is go to the repo in github, e.g. this tutorial's repo and go to Clone or download on the right top corner and select use ssh as shown:

Copy the url for the repo

Now spin up a terminal and go to the folder where you intend to parent your repo and type

git clone [email protected]:animalito/github_tutorial.git

https

You can also set it up via https and caching your credential by using the credential helper

What is this weird (but awesome) .md file?

To write beautiful stuff (like this document), use Markdown! It really is awesome.

For an amazing cheatsheet.

Incidentally, you can easily turn a markdown file into a presentation! For those RStudio users, checkout this one out.

Anything else?

If you find this useful, want to contribute or whatever, don't be a stranger! Drop us a line.

About

Mini tutorial enphasizing uses in social sciences

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published