#file: git-cheat-sheet.sh v1.0.0 docs at the end
#how-to install it on Ubuntu,RH and cygwin
apt-get install -y git
yum install -y git
setup-x86_64.exe -q -s http://cygwin.mirror.constant.com -P "inetutils,wget,open-ssh,curl,grep,egrep,git"
# pretend starting from different directory
git -C ..
# to to the tmp dir
cd /tmp
# set a pw run-time store in the cache
git config --global credential.helper cache
git config --global core.editor "vim"
git config credential.helper 'cache --timeout=3600'
# configure the user name and e-mail for git
git config --global user.name "YordanGeorgiev"
git config --global user.email "yordan.georgiev@gmail.com"
# configure push behaviour
git config --global push.default simple
# add the remote
git remote add origin https://github.com/YordanGeorgiev/isg-pub.git
# initialize a new git repo
git init
# clone the existing repo from the Internet
git clone https://github.com/YordanGeorgiev/isg-pub.git
# move the .git dir to the
# ups something went rong should redo
git rm --cached -r .
# add the product version dir
git add -v --all isg-pub.0.8.9.dev.ysg
# force remote repo rebuild
git push --force -u origin master
git push -u origin master
# initialize
git init
# add remote origin
git remote add origin https://github.com/YordanGeorgiev/isg-pub.git
https://github.com/YordanGeorgiev/nzbackup-runner.git
# verify
git remote -v
git config --global user.name "YordanGeorgiev"
git config --global user.email "yordan.georgiev@gmail.com"
# make git remember your pass
git config --global credential.helper cache
git config credential.helper 'cache --timeout=3600'
# stop make git remember your pass
# get help
# git --help
# simly add all the files from the current directory
git add --all
git rm --cached -r .
# dry run adding verbose a dir
git add -v -n --all isg-pub.0.8.9.dev.ysg
#create the master branch
git push --force -u origin master
git push -u origin master
git commit -m "Adding $component_name $component_version files recursively "
git push
git log
git status
# to remove all the files
git rm *
# to force master branch re-creation
man git-branch
wget --no-check-certificate https://github.com/$MyGitUserName/nzbackup-runner/archive/master.zip
# how-to clone
git_repo_url=https://yordan.georgiev@git.aktia.biz/scm/~yordan.georgiev/core-5971.git
git clone "$git_repo_url"
# add the reamde file for the new project
touch README.md
git add README.md
git pull origin master
# how-to add all the files ( except those matching the $issue/.gitignore )
git -C $issue add --all
git -C $issue commit -m "vw_INTIME_GL-create-view.sql v1.0.3 - re-write start with GL accounts"
git -C $issue push origin master
# how-to remove all the files from staging
git -C $issue reset HEAD -- .
# how-to reset the local git repository to match exactly the remote one
#1. save your current branch's state before doing this (just in case), you can do:
git commit -a -m "Saving my work, just in case"
git branch $issue.bak
#2. get the remote repository
git fetch origin
git reset --hard origin/master
# Purpose
#==============================================================================
#
# VersionHistory
#==============================================================================
# 1.1.0 --- 2015-07-30 14-46-56 --- added remote on top of local
# 1.0.0 --- 2013-09-20 22:25:56 --- Initial version
#eof file: git-cheat-sheet.sh
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!