Git

From HackerNet
Revision as of 17:30, 1 January 2016 by Helikopter (talk | contribs)
Jump to: navigation, search

WIP

Git är ett versionshanteringsprogram som är gratis och open source. Det skapades 2005 för att hantera källkoden till Linuxkärnan.

Installation

sudo apt-get install git-core

Konfiguration

Status

git status

Repo

Skapa nytt repo

mkdir ~/dev && cd ~/dev
echo "reponame" >> README.md
git init
git add README.md
git commit -m "first commit"

Klona repo

git clone https://github.com/USERNAME/REPONAME.git

Branch

Skapa en ny branch

git checkout -b NAME
git branch

GitHub

Username

git config --global user.name "Programming"
git config --global user.email "user@hackernet.se"
git remote add origin https://github.com/user/reponame.git
git push -u origin master

Password cache

git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'