Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 12676
b: refs/heads/master
c: 7f8cfad
h: refs/heads/master
  • Loading branch information
pclouds authored and gitster committed Sep 18, 2007
1 parent 7c0db29 commit 792e398
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/todo: 4c05ab6fe690e7c62c81875193bad0ac55e3cb7c
refs/heads/master: 53271411e7c4d9b92cc5aa1cc02492e9a3593d23
refs/heads/master: 7f8cfadf218c8b28caf52b1490fb8b881945b0ea
38 changes: 38 additions & 0 deletions trunk/contrib/fast-import/git-import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
#
# Performs an initial import of a directory. This is the equivalent
# of doing 'git init; git add .; git commit'. It's a lot slower,
# but is meant to be a simple fast-import example.

if [ -z "$1" -o -z "$2" ]; then
echo "Usage: git-import branch import-message"
exit 1
fi

USERNAME="$(git config user.name)"
EMAIL="$(git config user.email)"

if [ -z "$USERNAME" -o -z "$EMAIL" ]; then
echo "You need to set user name and email"
exit 1
fi

git init

(
cat <<EOF
commit refs/heads/$1
committer $USERNAME <$EMAIL> now
data <<MSGEOF
$2
MSGEOF
EOF
find * -type f|while read i;do
echo "M 100644 inline $i"
echo data $(stat -c '%s' "$i")
cat "$i"
echo
done
echo
) | git fast-import --date-format=now

0 comments on commit 792e398

Please sign in to comment.