Index menü
git symbolic-ref HEAD 'refs/heads/newbranch' rm '.git/index' git clean -fdx git commit --allow-empty -m 'Initial commit'
git fetch --all --prune --tags
--all | minden remote használata |
--prune | a távol törölt branch-ek törlése helyileg |
--tags | a távol változott tag-ek lekövetése helyileg |
git push origin --all git push origin --tags
--all | minden referencia feltöltése |
--tags | minden tag feltöltése / frissítése |
--all
nem foglalja magába a --tags
-et!
git remote rm 'origin-foo'
git tag -d 12345
git push origin :refs/tags/12345
git config --local rerere.enabled true git config --local rerere.autoupdate true
git log 'from-patch..to-patch' --pretty=email --patch-with-stat --reverse './wanted-folder-and-subfolders' > 'patches'
git am -3 < 'patches'
git reflog expire --expire=now --all git gc --aggressive --prune=now
git cherry-pick --abort git am --abort git merge --abort git rebase --abort
git reset --hard git clean -fd
git lost-found gitk $(cd '.git/lost-found/commit' && echo ??*)
# let's make sure we have all we need to proceed sudo apt-get install libexpat1-dev asciidoc libz-dev gettext curl # let's create the directory to host the built artifacts sudo mkdir /opt/git-1.7.4.1-static # we are ready to download and unpack latest version of git sources (last: http://git-scm.com/) curl http://kernel.org/pub/software/scm/git/git-1.7.4.1.tar.bz2 | tar xvj cd git-1.7.4.1/ # then compile and install the files in the target directory we created ./configure --prefix=/opt/git-1.7.4.1-static CFLAGS="${CFLAGS} -static" NO_OPENSSL=1 NO_CURL=1 sudo make install sudo make install-doc
git init
C:\Users\foo\Desktop\users.txt
fájlban (kis-, nagybetű érzékeny!): foobar = Foo Bar <foo.barm@gmail.com> Fooar = Foo Bar <foo.barm@gmail.com> FooBar = Foo Bar <foo.barm@gmail.com> APPLETREE = Apple Tree <applet@gmail.com>
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hideDotFiles = dotGitOnly [svn-remote "svn"] noMetadata = 1 url = http://localhost:2080/svn/Devel/MAINLINE fetch = :refs/remotes/git-svn [svn] pathnameencoding = iso-8859-2 authorsfile = d:/Users/foo/Repositories/git/users.txt
git svn init 'http://localhost:2080/svn/Devel/MAINLINE' --no-metadata git svn init 'http://localhost:2080/svn/Test' --no-metadata git config svn.authorsfile '/c/Users/foo/Desktop/users.txt' git config svn.pathnameencoding 'cp1252' # Linuxon ne állítsd be! git svn fetch rm -r '.git/svn' '.git/refs/remotes/git-svn'
git filter-branch --env-filter ' # bash kód a környezeti változók lecserélésére ' HEAD
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
man git-filter-branch
GIT_COMMIT
GIT_DIR
GIT_INDEX_FILE
GIT_OBJECT_DIRECTORY
GIT_QUIET
GIT_WORK_TREE
git filter-branch --tag-name-filter 'cat' --env-filter ' oldname="FooBarZ" oldemail="foobarz@dummy.com" newname="Foo Bar" newemail="foo@bar.com" [ "$GIT_AUTHOR_NAME" == "$oldname" ] && GIT_AUTHOR_NAME="$newname" [ "$GIT_AUTHOR_EMAIL" == "$oldemail" ] && GIT_AUTHOR_EMAIL="$newemail" [ "$GIT_COMMITTER_NAME" == "$oldname" ] && GIT_COMMITTER_NAME="$newname" [ "$GIT_COMMITTER_EMAIL" == "$oldemail" ] && GIT_COMMITTER_EMAIL="$newemail" ' -- --all
git pull '../forras-repo' master
git rebase --root ...
git for-each-ref --format='%(refname)' refs/original/ | xargs -n 1 git update-ref -d
rm -rf '.git/refs/original'
--force
kapcsolót.
git subtree split --prefix='path/of/code' -b 'destination-branch'
export path_prefix='foo' git filter-branch --tag-name-filter 'cat' --index-filter ' git ls-files -s | sed "s>\t\"*>&'"${path_prefix}"'/>" | GIT_INDEX_FILE="${GIT_INDEX_FILE}.new" git update-index --index-info && mv "${GIT_INDEX_FILE}.new" "${GIT_INDEX_FILE}" ' -- --all
git subtree split --prefix='path/of/code' -b 'destination-branch'
Pl. az összes fájl és mappa mozgatása egy újonnan létrehozott web
könyvtárba:
git filter-branch --tree-filter ' mkdir -p web for fso in $(ls -A | grep -Ev '"'"'^(web|\.git)$'"'"') do new="web/$(echo "${fso}" | sed '"'"'s>^poc->>'"'"')" echo "# $fso >> $new" mv "$fso" "$new" done ' -- --all
local_commit="`git rev-parse HEAD`" remote_commit="`git rev-parse @{u}`" if [ "${local_commit}" == "${remote_commit}" ]; then echo "No changed" fi
git add -A && git absorb -b origin/master --force