![]() ![]() This git remote command queries the remote machine over the network about its branches. New-branch pushes to new-branch (fast-forwardable) Io-socket-ip new (next fetch will store in remotes/origin) You can view all the remote branches (that is, the branches on the remote machine), by running git remote show : $ git remote show origin (At least, I wouldn't call it that!) It's just called a remote-tracking branch. ![]() You can update your remote-tracking branches using git fetch, which git pull uses behind the scenes.Įven though all the data for a remote-tracking branch is stored locally on your machine (like a cache), it's still never called a local branch. Think of your remote-tracking branches as your local cache for what the remote machines contain. You can view a list of all the remote-tracking branches on your machine by running git branch -r: $ git branch -rĮach remote-tracking branch has a file under. Remote-tracking branches (still on your machine) If you wish to set tracking information for this branch you can do so with:Ģ. Please specify which branch you want to merge with. There is no tracking information for the current branch. If the branch is not set up to track another branch, you'll get an error like this one: $ git checkout new-feature They allow you to run git pull and git push, without specifying which upstream branch to use. New-feature b760e04ed Another example commit messageįrom this command's output, you can see that the local branch master is tracking the remote-tracking branch origin/master, and the local branch new-feature is not tracking anything.Īnother way to see which branches are tracking branches is by having a look at. You can view which one of your local branches are tracking branches using git branch -vv: $ git branch -vv You create one by running git branch -track. Tracking local branches are associated with another branch, usually a remote-tracking branch. Non-tracking local branches are not associated with any other branch. There are two types of local branches on your machine: non-tracking local branches, and tracking local branches. You can view a list of all the local branches on your machine by running git branch: $ git branchĮach local branch has a file under. On a remote machine, you've just got one type of branch. TLDR: on your local machine, you've got three types of branches: local non-tracking branches, local tracking branches, and remote-tracking branches. You can see which locations these remote names are shortcuts for, by running git remote -v: $ git remote -vĮach remote has a directory under. To list all the remotes, run git remote: $ git remote Most often, you'll just have one, named origin. Each machine or location is called a remote, in Git's terminology, and each one may have one or more branches. If you're using Git collaboratively, you'll probably need to sync your commits with other machines or locations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |