-
Notifications
You must be signed in to change notification settings - Fork 20
Git
-
GitHub
- GitHub Widescreen Chrome extension
- Wide GitHub Chrome extension
- BitBucket
- GitLab
- Gitea: self-hosted
- git - the simple guide
- Think Like (a) Git
- Git Immersion
- Basic Git tutorial with illustrations
- Bitbucket 101
- Pro Git Book
- A successful Git branching model
- Git branching model for efficient development
- Git workflows
- Understanding the GitHub Flow
- Git (the Windows edition includes a Bash emulator)
- GitKraken (Windows, Linux, OS X) (might slow down for really big repositories)
- MSysGit (Windows)
- SouceTree (Windows, Mac OS X)
- TortoiseGit (Windows)
- SmartGit (Windows, Linux)
- Other GUI clients
Git in Eclipse
- EGit is available on the main Eclipse update site (since Juno)
- http://eclipse.github.io/
- Learn Git in 20 Minutes
- Git for Ages 4 and Up
- O'Reilly Webcast: Git in One Hour – from 2009, terrible audio
- Resolving a merge conflict
- Edit it (optionally using EGit's Merge Tool)
- Mark as merged by adding it to the index
- Set the execute permissions on the updated files
git update-index --chmod=+x <file>
- SmartGit requires a 32-bit JDK or JRE to work. Possible error messages include:
-
"The JAVA_HOEME environment variable does not point to a working 32-bit JDK or JRE"
-
The SMARTGIT_JAVA_HOME variable is not set properly.
The solution is to simply install a 32-bit JDK and set the SMARTGIT_JAVA_HOME environment variable accordingly (e.g.
SMARTGIT_JAVA_HOME
toc:\Program Files (x86)\Java\jdk1.8.0_111
.
-
git commit --allow-empty -m "Trigger build"
git grep <regexp> $(git rev-list --all)
(source)
git grep <regexp> $(git log --pretty=format:"%H" README.md) -- README.md
FILE_BASE=README ; FILE_EXT=.md ; FILE="$FILE_BASE$FILE_EXT" ; i=0 ; for HASH in $(git log --oneline "$FILE" | awk '{print $1}') ; do git show $HASH:"$FILE" > "$FILE_BASE-$i-$HASH$FILE_EXT" ; ((++i)) ; done
git branch -a | grep -oP "remotes/\K\S*" | xargs -n1 -I{} bash -c "git show {}:README.md 2>/dev/null | wc -l"
The file must contain LF for a non-zero result.
git ls-files -i --exclude-standard -c
(source)
The git push
command often fails if the remote contains changes which have not yet been applied to the local branch.
To get a timely notification, add the following command to your ~/.bashrc
file (play
is provided by SoX in the sox
package on Fedora):
git() {
if [ ${#} -gt 1 ] && [ ${1} = "push" ]; then
/usr/bin/git ${@} || play -q -n synth 0.05 sin 480
else
/usr/bin/git "${@}"
fi
}
Or, in zsh
(needs SoX – brew install sox
):
function git {
if [ ${#} -gt 1 ] && [ ${1} = "push" ]; then
/usr/bin/git ${@} || play -q -n synth 0.05 sin 480
else
/usr/bin/git "${@}"
fi
}
This example uses the play
binary but other commands capable of producing a "beep" sound can also work.
To create meaningful diffs between the binary .doc
files, perform the following steps:
-
Install the
antiword
package withapt
/dnf
. -
Add the following section to your
~/.gitconfig
file:
[diff "word"]
textconv = antiword
- In the cloned repository, create the file
.git/info/attributes
and add the following:
*.doc diff=word
- Git diffs (
git show
,git diff
,git diff --staged
, etc.) should now show meaningful diffs for.doc
files.
For PR 57, do:
git fetch origin pull/57/head:pull-57
git checkout pull-57
Some assume starring repositories on GitHub is just a like. It also seems to serve another purpose: it allows keeping the contributions of the repositories you contributed to.
We recommend starring any repositories you contribute to. That way, your commits to those repositories will remain in your contributions graph even if you leave the organization that owns the repository or delete your fork of the repository.
(source)