Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- git branch myNewBranch # Create local branch named "myNewBranch"
- git push -u origin myNewBranch # Pushes your newly created local branch "myNewBranch"
- # to the remote "origin".
- # So now a new branch named "myNewBranch is
- # created on the remote machine named "origin"
- git pull origin myNewBranch # Pulls new commits from branch "myNewBranch"
- # on remote "origin" into remote tracking
- # branch on your machine "origin/myNewBranch".
- # Here "origin/myNewBranch" is your copy of
- # "master" on "origin"
- git checkout myNewBranch # Switch to myNewBranch
- git pull # Updates remote tracking branch "origin/myNewBranch"
- # to be in sync with the remote branch "myNewBranch"
- # on "origin".
- # Pulls these new commits from "origin/myNewBranch"
- # to local branch "myNewBranch which you just switched to.
- $ git remote
- bitbucket
- origin
- $ git remote -v
- bitbucket git@bitbucket.org:flimm/example.git (fetch)
- bitbucket git@bitbucket.org:flimm/example.git (push)
- origin git@github.com:Flimm/example.git (fetch)
- origin git@github.com:Flimm/example.git (push)
- $ ls -F .git/refs/remotes/
- bitbucket/ origin/
- $ git branch
- master
- new-feature
- $ ls -F .git/refs/heads/
- master new-feature
- $ git branch -vv
- master b31f87c85 [origin/master] Example commit message
- new-feature b760e04ed Another example commit message
- $ git checkout new-feature
- $ git pull
- There is no tracking information for the current branch.
- Please specify which branch you want to merge with.
- See git-pull(1) for details
- git pull <remote> <branch>
- If you wish to set tracking information for this branch you can do so with:
- git branch --set-upstream new-feature <remote>/<branch>
- $ git branch -r
- bitbucket/master
- origin/master
- origin/new-branch
- $ tree -F .git/refs/remotes/
- .git/refs/remotes/
- ├── bitbucket/
- │ └── master
- └── origin/
- ├── master
- └── new-branch
- $ git remote show origin
- * remote origin
- Fetch URL: git@github.com:Flimm/example.git
- Push URL: git@github.com:Flimm/example.git
- HEAD branch: master
- Remote branches:
- io-socket-ip new (next fetch will store in remotes/origin)
- master tracked
- new-branch tracked
- Local ref configured for 'git pull':
- master merges with remote master
- new-branch merges with remote new-branch
- Local ref configured for 'git push':
- master pushes to master (up to date)
- new-branch pushes to new-branch (fast-forwardable)
- git branch -d <branchname>
- git branch -D <branchname>
- git branch -rd <remote>/<branchname>
- git branch <branchname> [<start-point>]
- git branch --track <branchname> [<start-point]
- git branch --track hello-kitty origin/hello-kitty
- git push --delete <remote> <branchname>
- git remote prune <remote>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement