Skip navigation

A reference for me


GIT REPO CREATE:
# login to remote server
ssh git@REMOTE_SERVER

# once logged in
mkdir example.git
cd example.git
git --bare init

# TO EXPORT THE SERVER TO THE INTERNET
http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#setting-up-a-public-repository

SERVER:
1.  Start up git-daemon &
2.  touch git-daemon-export-ok

CLIENT:
git clone git://myserverip/home/git/example.git



GIT REPO PUSH:
mkdir example
cd example
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@REMOTE_SERVER:example.git
git push origin master




# TO PUSH AT A LATER TIME, USING USER OVERRIDE SETTINGS
$ git config --global user.name "Tekkub"
$ git config --global user.email "tekkub@gmail.com"

# PER REPO BASIS
$ cd my_other_repo
$ git config user.name "Not Tekkub"
$ git config user.email "not@tekkub.net"




# you can only push using ssh
GIT PUSH
========
git push ssh://git@255.10.10.1/home/git/REPO master

FRom:
http://groups.google.com/group/gitorious/browse_thread/thread/978f2b506286f425/1c55538158adf28a




GIT REPO CLONE:

To get the lab #2 starting code base:

1. Download and install the most recent version of msysgit

2. Once you have it installed, open git bash. In git bash:

cd /c
mkdir repodir
cd repodir

git clone git://github.com/username/projectname

Later, to retrieve updates to the code:

git pull git://github.com/username/projectname


That command will pull the latest updates to the code to your machine



see what you added
==================
git status


UNDO adding
===========
git reset --hard






BRANCHING
=========
git branch branchName     # create a new branch from where you are
git checkout branchName   # switch to using the branch

work on the branch then commit it using

PUSH BRANCH
===========
git push ssh://git@255.10.10.1/home/git/repoTest BRANCHNAME

if you do'nt include BRANCHNAME it assumes ou want to push "master".



Cloning a branch
================
XXXXXgit clone git://255.10.10.1/home/git/repoTest master  # gets
you the master branch..

git clone git://255.10.10.1/home/git/repoTest

no WAIT.  the whole point of GIT is you get EVERYTHING.
NO WAIT.  you DON'T.  there ar eREMOTE branches whihc you see by

git branch -r # SHOWS REMOTE BRANCHES

git show-branch # shows you the curent branch and commit summary

git checkout -b (new_branch_name) creates and switches to a branch




To check out the actual code though, after CLONE, you hvae to
git checkout origin/branchName

this also seems to work:
git pull git://255.10.10.1/home/git/repoName branchName

the funy thing is i'm still on *(no branch), not the actual bracn i'm
supposed to be on



VERY OOD USMMARY
http://git.or.cz/course/svn.html




git log



ah, i see.  a remote branch "you never mess with remote branches", -
meaning its somebody elses' bracnh they're working on and is liable
for seroius chagne so why would you formally say you'r echekcing it
out/  you can't.

so you instead can TRACK their bracnh, which is sort of informally
saying "mirror that to me" but you can't formally WORK ON THEIR BRACNH
unless they are commited to HEAD

git checkout --track -b raster-test-mine origin/raster-test

this "branch raster-test-mine set up to track remote branch
refs/remotes/origin/raster-test

the REMOTES branches it seems are REMOTE TO THE REPOSITORY, not to
YOU.  its SOME USER SOMEHWERE IN SPACE that is REMOTE to the SERVER.

so once you work on your branch a bit, you can PUSH your branch ot the
server by commiting etc

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: