-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
You can use it as git branch <branchname> [start-point] and it creates a new branch of name <branchname>. If a starting point is specified, that will be where the branch is created, otherwise it will be created at the current HEAD. The sequence git branch xyz abc git checkout xyz can also be written as git checkout -b xyz abc as per the previous commit.
- Loading branch information
Linus Torvalds
committed
Jul 12, 2005
1 parent
91dcdfd
commit 37f1a51
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
. git-sh-setup-script || die "Not a git archive" | ||
|
||
branchname="$1" | ||
rev=$(git-rev-parse --verify --default HEAD "$2"^0) || exit | ||
|
||
[ -z "$branchname" ] && die "git branch: I want a branch name" | ||
[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists" | ||
|
||
echo $rev > "$GIT_DIR/refs/heads/$branchname" |