git cheatsheet

to create a local & remote repo

on a0 in /usr3/phomlish/git create RepoName directory
mkdir RepoName
cd RepoName
git init –bare

phomlish@a0:/usr3/phomlish/git/jukebox$ git init –bare
Initialized empty Git repository in /usr3/phomlish/git/jukebox/

****

in working directory (like on mac)
go where the code exists
w01:jukebox phomlish$ pwd
/Users/phomlish/go/src/jukebox

git init
git add -A
git commit -m init

git remote add origin ssh://a0:2222/usr3/phomlish/git/jukebox
git push –set-upstream origin master
git push

****

in working directory (like on mac)
make sure you have a .gitignore
git clone ssh://a0:2222/usr3/phomlish/git/com.mydetv
git add -A
git commit
git push –set-upstream origin master

git status
git log
# which checkout we’re on
git show

git checkout

Create the branch on your local machine and switch in this branch :
git checkout -b [name_of_your_new_branch]
git checkout -b dev

Change working branch :
git checkout [name_of_your_new_branch]
git checkout master

git push
git push origin [name_of_your_new_branch]

# let’s have 2 remotes!
# on a0
phomlish@a0:/usr3/phomlish/git/mydetv-swarm$ git init –bare
Initialized empty Git repository in /usr3/phomlish/git/mydetv-swarm/
# on local
git remote add origin ssh://a0:2222/usr3/phomlish/git/mydetv-swarm

# merging!!!
# from dev to master locally
git checkout master
git merge dev
git push origin master

Leave a Reply

Your email address will not be published. Required fields are marked *