Cambios a zip
zip modified-files.zip $(git diff HEAD^ --name-only)
$HOME/.gitconfig
[http]
sslVerify = false
[user]
name = sidlors
email = [email protected]
[alias]
lodag = log --oneline --decorate --color --all --graph
lod = log --oneline --decorate --color
co = checkout
ci = commit
ap = add -p
am = commit --amend
unadd = reset HEAD --
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[difftool "sourcetree"]
cmd = 'C:/Program Files/WinMerge/WinMergeU.exe' \"$LOCAL\" \"$REMOTE\"
[mergetool "sourcetree"]
cmd = "'' "
trustExitCode = true
[core]
autocrlf = true
git push origin HEADgit rebase -Xtheirs branch-b # <- ours: branch-b, theirs: branch-a
git merge -Xtheirs branch-b # <- ours: branch-a, theirs: branch-bLo mas seguro es que tenga conflictos y tengamos que decidir entre theirs o ours
git checkout --theirs path/to/filegit checkout --ours path/to/fileagregamos lo que si queda
git add path/to/fileY continuamos el proceso, siempre revisando si
git rebase --continuegit pull -s recursive -X theirs <remoterepo or other repo>git pull -X theirsgit diff --name-only --diff-filter=Ugit push origin $rama_actualgit reset --HARD $SHA1git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --allgit remote show origingit fetch origingit checkout --track -b $rama origin/$ramagit checkout -t origin/$ramagit branch -a# * master # remotes/origin/HEAD -> origin/master # remotes/origin/baremacion # remotes/origin/bootstrap # remotes/origin/fallo_registro # remotes/origin/master
git checkout -b baremacion remotes/origin/baremaciongit branch $branchgit checkout -b $new_branch $othergit branch -d $branchgit push origin :$branchgit fetch -pgit remote prune origingit branch -m $nombre_rama_anterior $nombre_rama_nuevoIgnorar el salto de línea en Git http://help.github.com/line-endings/
git config --global core.autocrlf inputgit checkout $rama
git cherry-pick $SHA1git log --left-right --graph --cherry-pick --oneline feature...branchgit tag git tag -a v1.2 $SHA1git push --tagsgit reset --soft HEAD~1git revert HEADgit reset --soft HEAD^git commit --ammend -m "Nuevo mensaje"Subir a la rama Commits parciales (los ficheros que no añado se quedan en el stash y se recuperan luego)
git add $file
git commit -m "Mensaje"
git stash
git pull --rebase origin $rama
git push origin rama
git stash popgit log origin/master..mastergit branch -r --contains $commit-
- Deshacer commits
-
- Unir commits
-
- Reordenar commits
-
- ...
git rebase -i HEAD~10 # Esto mira los 10 últimospick ce2b738 Commit message 1 pick 2a3cdf7 Commit message 2
# Y podremos realizar las siguientes operaciones sobre los commits # inlcuyendo reordenar los commits # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell
git filter-branch --env-filter 'GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE; export GIT_COMMITTER_DATE' ..HEAD
http://www.bluemangolearning.com/blog/2009/03/recovering-from-a-disastrous-git-rebase-mistake/