Usar git local
Enviado: 09 Dez 2014 14:53
Por acaso alguém entendeu como usar o GIT local?
A intenção é controlar alterações nos fontes próprios.
A intenção é controlar alterações nos fontes próprios.
//inicializar repositorio, tem que ser feito dentro do diretorio, que se que fazer controle,
git init
//adicionar arquivos alterados no repositorio temporario
git add *.prg
git add *.ch
git add *.bat
//transfere arquivos alterados para repositorio local
git commit -m "deboni biblioteca"
git tag -a v1.0.0.0 -m "deboni biblioteca versao 1.0.0.0"
git tag v1.0.0.0
bem é so ler o manual, ver os exemplos e partir para o abraço.
mais exemplos
secao 3.2 do manual, criando branch e fazendo merge
;criar branch spedfiscal
git checkout -b spedfiscal ;e igual fazer [git branch spedfiscal] seguido de [git checkout spedfiscal]
;fazer as alteracoes necesarias
;se precisar voltar ao branch master, para fazer algum acerto de emergencia
;faz um add dos prg´s alterados
git add prg
;faz um commit com as alteracoes ja feitas para branch spedfiscal
git commit -a -m "implantando sped fiscal"
retorna ao branch master
git checkout master
;cria outro branch, para melhor controle, nao e obrigatorio
git checkout -b acerto
;faz as alteracoes necessarias
;faz add dos arquivos alterados
git add arquivos
;grava alteracoes
git commit -a -m "acertado tal coisa"
;retorna ao branch master
git checkout master
;faz merge para atualizar master com branch acerto
git merge acerto
;dando tudo certo, apaga o branch acerto
git branch -d acerto
;volta pro branch spedfiscal
git checkout spedfiscal
;voce pode incluir as alteracoes feitas em acerto, fazendo merge com master,
;ou pular e fazer as junção dos arquivo no final da alteração, mas e provavel que de mais complito, se esperar pra fazer mas tarde.
git merge master
;faz as alteracoes, adiciona arquivos alterados
git add arquivos
;grava
git commit -a -m "Terminado sped fiscal versao teste"
;volta para master
git checkout master
;faz merge master com spedfiscal, atualiza branch master com atualizacoes de branch spedfiscal
git merge spedfiscal
;ao inves de fazer merge pode ser feito rebase, codigo fica mais limpo, nao usar por enquanto, ler secao 3 melhor antes de usar
;git checkout spedfiscal
;git rebase master
;apagar branch spedfiscal
git branch -d spedfiscal
;caso não haja complito, é só fazer commit, se tiver tem que resolver primeiro
git -a -m commit "
;ao inves de fazer merge pode ser feito rebase, codigo fica mais limpo
git checkout spedfiscal
git rebase master
ChangeLog.txt ident
# Default
* text=auto
# These files are text and should be normalized (convert CRLF => LF)
*.1 text
*.api text
*.bas text
*.bat text
*.c text
*.cfg text
*.ch text
*.cpp text
*.css text
*.def text
*.dif text
*.h text
*.hb text
*.hbc text
*.hbm text
*.hbp text
*.hbx text
*.html text
*.in text
*.ini text
*.js text
*.log text
*.m text
*.md text
*.mft text
*.mk text
*.nsi text
*.pem text
*.po text
*.prg text
*.qrc text
*.rb text
*.rc text
*.sfc text
*.spec text
*.sx text
*.tpl text
*.txt text
*.ucf text
*.vbs text
*.xml text
*.xsl text
*.y text
*.yml text
*.yyc text
*.yyh text
# Text files with fixed EOL requirements
*.bat text eol=crlf
*.sh text eol=lf
# Binary files
*.a binary
*.afm binary
*.bmp binary
*.dat binary
*.dbf binary
*.exe binary
*.frm binary
*.gif binary
*.icns binary
*.ico binary
*.jpg binary
*.lbl binary
*.lib binary
*.mdb binary
*.ng binary
*.odt binary
*.pdf binary
*.pfb binary
*.png binary
*.sq3 binary
*.tif binary
# TOTEST:
#*.c text diff=cpp
#*.h text diff=cpp
#*.htm text diff=html
#*.html text diff=html
#*.m text diff=objc
#*.rb text diff=ruby
# To validate, run:
# 'git ls-files -i --exclude-standard'
# build generated files
/include/hbverbld.h
bin/*/
lib/*/
obj
.hbmk/
*.hbl
*.hbd
*.hbr
*.hrb
# 'install'-ed binaries
*.exe
*.dll
*.dxe
*.dylib
*.so
*.sl
*.lib
*.a
*.ppo
*.zip
*.7z
*.dbf
*.fpt
*.cdx
*.idx
*.ntx
*.mem
*.ped
*.xml
*.txt
*.err
*.xml
*.dif
*.pk
*.tmp
*.log
*.txt
*.bkp
*.ttt
# packages
/pkg/
# not hosted contribs
/addons/
# misc junk
.DS_Store
*.bak
# exceptions
!libunicows.a
!unicows.lib
!lib/3rd
!config/*.exe
!/*.exe