Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

GitLink

Guides

  • Git Interfaces
  • GitLink
  • Git Reference Operations
  • Low Level Git Operations

Symbols

  • GitAdd
  • GitAddRemote
  • GitAheadBehind
  • GitBranchQ
  • GitCheckoutReference
  • GitClone
  • GitClose
  • GitCommit
  • GitCommitQ
  • GitCreateBranch
  • GitCreateTag
  • GitDeleteBranch
  • GitDeleteRemote
  • GitDeleteTag
  • GitExpandTree
  • GitFetch
  • GitInit
  • GitMergeBase
  • GitMerge
  • GitMoveBranch
  • GitObject
  • GitOpen
  • GitProperties
  • GitPull
  • GitRange
  • GitReadBlob
  • GitRemoteQ
  • GitRepo
  • GitRepoQ
  • GitRepos
  • GitReset
  • GitSetUpstreamBranch
  • GitSHA
  • GitSignature
  • GitStatus
  • GitType
  • GitUpstreamBranch
  • GitWriteBlob
  • GitWriteTree
  • ToGitObject
Wolfram`GitLink`
GitCheckoutReference
​
GitCheckoutReference
[repo,ref]
sets the
repo
's HEAD to point to
ref
and checks out
ref
into the working directory.
​
Details
▪
When it succeeds,
GitCheckoutReference
will return a
GitObject
corresponding to the commit now being pointed to by HEAD.
▪
ref
can be a string representing a branch, tag, or SHA, or it can be a
GitObject
. If
ref
is not a branch name, then the operation will leave
repo
in a detached head state.
▪
GitCheckoutReference
will only succeed if it can update the working tree and index of
repo
without introducing any conflicts. If the action of checking out
ref
would change any files that are changed in the working tree or index,
GitCheckoutReference
will leave
repo
unchanged and return
$Failed
.
▪
GitCheckoutReference
will return
$Failed
if
repo
has no working tree or index.
▪
The following options can be given:
"Create"
False
if true, then create the named branch at the current position and check it out
"Force"
False
whether to completely override any changes in the working tree and index
"UpstreamBranch"
Automatic
name of the branch to set as an upstream branch
"UpstreamRemote"
Automatic
which remote to check to attempt to infer an upstream branch
▪
If
ref
doesn't exist as a local branch, but it does exist as a remote branch on a remote in
repo
, then
GitCheckoutReference
will create a local branch with the remote branch as an upstream branch.
▪
If
ref
doesn't exist as a local or remote branch, then
GitCheckoutReference
will return
Missing
["NoReference"]
.
SeeAlso
GitResetRepo
 
▪
GitCheckoutFiles
 
▪
GitStatus
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com