setup variables:

git config --global user.name "Phyrum Tea"
git config --global user.email This email address is being protected from spambots. You need JavaScript enabled to view it.
 

verify variables

git config --list --global
 

create a remote bare repo

cd /Users/ptea
mkdir git
git init --bare --shared WiseCards.git
 

convert current project to git project

cd wisecards
vi .gitignore // to ignore bin/ and gen/ folders.
git init
git add .
git commit -m ‘Initial commit’
 

to remove or delete multiple files

git add -u
 

add content to the remote bare repo

git remote add origin /Users/ptea/git/wisecards.git
git push -u origin master
 

after editing some files

git add .
git commit -m 'added new benchmarks'
git push
 

shortcut for add and commit.

git commit -a -m 'added new benchmarks'
git push
 

start new branch alpha15

git branch alpha15
git checkout alpha15
 

shorthand for new branch and checkout

git checkout -b develop
 

make branch alpha15 public

git push origin alpha15
 

continue work on master

git checkout master
git tag 1.5.0.3a
 

replace tag git tag -f 1.5.0.3a

git push origin -f 1.5.0.3a
git push origin 1.5.0.3a
 

a. initial on the other mac with access to network drive.

git clone file:///Volumes/ptea/git/wisecards.git
 

b. updates after clone

cd wisecards
git pull

git checkout alpha15
 

move master to develop

git checkout master
git merge develop

git checkout alpha15
git merge master
 

publish the 2 merges

git push origin master
git push origin alpha15
 

delete unused branch

# list merged branches for cleanup/delete
git branch --merged master

git branch -d alpha15
git push origin :alpha15
 

show url

git remote -v
 

change origin

git remote set-url origin file:///C:/Users/ptea/git/WiseCrards.git

file:///X:/pht/Git/bbtcare.git
 

show history

git log --pretty=oneline
 

rebase

git checkout master
git pull
git checkout alpha15
# git branch --set-upstream-to origin/alpha15
git rebase master
git push --force
 

rebase and squash last 2 commits

git rebase --interactive HEAD~2