background preloader

Git

Facebook Twitter

Change commit messages of past Git commits - makandra notes. Managing Branches with Git. Git Reference. Icefox's git-achievements at gh-pages - GitHub. A few git tips you didn't know about. Notice: some of these commands or flags require git version 1.7.2. On OS X, upgrade easily with Homebrew: brew install git Show branches, tags in git log $ git log --oneline --decorate 7466000 (HEAD, mislav/master, mislav) fix test that fails if current dir is not "hub" 494a414 fix cherry-pick of a commit URL 4277848 (origin/master, origin/HEAD, master) whoops d270fae bugfix: git init -g 9307af3 test deps 8ccc17e 64bb19c bugfix: variable name 546726a dont need you 3a8d7af (tag: v1.3.1) v1.3.1 197f429 (tag: v1.3.0) v1.3.0 a1e1a50 not important 3c6af16 magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation Diff by highlighting inline word changes instead of whole lines $ git diff --word-diff # Returns a Boolean. def command?

This flag works with other git commands that take diff flags such as git log -p and git show. Short status output $ git status -sb M ext/fsevent/fsevent_watch.c ?? Push a branch and automatically set tracking. Atualizar arquivos do sistema em produção após git push. Configurando o Terminal no Mac OS X. Se você passa muito tempo usando o Terminal do Mac OS X, veja algumas dicas de como personalizar e melhorar sua produtividade. Arquivos de configuração O Terminal carrega um arquivo chamado .bash_profile toda vez que uma nova aba é aberta.

Existem outros arquivos que funcionam de modo semelhante, como .bash_login e .profile. Esses arquivos devem ser colocados em seu diretório home. Para ir até este diretório, digite um dos comandos abaixo. cd $HOME cd ~ cd Nós iremos editar o arquivo $HOME/.bash_profile. Cores O primeiro passo é adicionar cores à saída do Terminal. Export GREP_OPTIONS="--color=auto" export GREP_COLOR="4;33" export CLICOLOR="auto" alias ls="ls -G" Essas configurações irão tornar o comando ls e grep coloridos, como no exemplo abaixo. Como você pode perceber, as cores não ficaram muito boas. Depois de instalar o SIMBL, baixe o bundle TerminalColours. Abra as preferências. Se preferir, baixe o arquivo IR_Black.terminal e dê um duplo clique para adicioná-lo. Atalhos de Teclado. Welcome to GitCasts. Blog do Grasselli: Como eu uso o GIT. Antes de mais nada, gostaria de dar os devidos créditos ao @rogerio_augusto porque foi ele quem me ensinou boa parte dos itens que vou escrever hoje.

Pull e Push Bom, vou começar pelo mais básico, enviar e receber commits do repositório remoto. Geralmente o pessoal acredita que a fórmula é essa: commito alguma coisafaço pull para ver se tem alguma coisa no remotofaço push para enviar para ele Isso até que funciona, mas eu prefiro uma outra abordagem que deixa a árvore dos commits mais organizada. O pull nada mais é do que um fetch (baixa objetos e referências do remoto) mais merge (junta duas ou mais histórias).

Imagine que você baixou tudo que estava no remoto e fez um commit. Para não ter que criar um repositório remoto para o exemplo, eu fiz o merge entre dois repositórios locais, mas o resultado é o mesmo. Com o merge ele mostra que os commits foram feitos em paralelo, mas as vezes essa informação não é tão relevante, e vale mais a pena deixar a árvore organizada. Git fetch Viram? Git add . Dicas Locaweb » Blog Archive » Git – Dicas e truques. No dia-a-dia utilizar recursos das ferramentas certas ajudam a agilizar nosso trabalho, tratando-se de controle de versões o Git tem diversos truques interessantes. Vou resumir de forma rápida alguns comandos que utilizo diariamente, a idéia é concentrar aqui novas dicas que forem aparecendo, então sugestões são bem vindas. Um dos comandos mais úteis e interessantes que tenho utilizado ultimamente para fazer revisão de código ou para ter um histórico do projeto é o “instaweb” que inicia um servidor local onde podemos navegar ( pelos commits e verificar as diferenças do repositório de uma forma bem simples e clara.

É importante lembrar que ao subir o serviço o terminal fica liberado sendo necessário parar o servidor após o uso senão o processo continuará “rodando”. git instaweb --httpd webrick git instaweb --httpd webrick --stop git stash git stash apply git commit -m "Alguma mensagem errada" git commit --amend -m "Correção da mensagem" Git User's Manual (for version 1.5.3 or newer) This chapter covers internal details of the Git implementation which probably only Git developers need to understand. All objects have a statically determined "type" which identifies the format of the object (i.e. how it is used, and how it can refer to other objects). There are currently four different object types: "blob", "tree", "commit", and "tag".

Regardless of object type, all objects share the following characteristics: they are all deflated with zlib, and have a header that not only specifies their type, but also provides size information about the data in the object. It’s worth noting that the SHA-1 hash that is used to name the object is the hash of the original data plus this header, so sha1sum file does not match the object name for file (the earliest versions of Git hashed slightly differently but the conclusion is still the same). The following is a short example that demonstrates how these hashes can be generated manually: $ echo "Hello world" >hello.txt What does this mean? Gitorious. Table of Contents. Git Community Book. A Visual Git Reference.