git checkout old_branch git branch new_branch
This will give you a new branch “new_branch” with the same state as “old_branch”.
This command can be combined to the following:
git checkout -b new_branch old_branch
Related Posts:
- How to remove local (untracked) files from the current Git working tree
- Git fetch remote branch
- Git fetch remote branch
- Why do I have to “git push –set-upstream origin
“? - How to get the current branch name in Git?
- How do you create a remote Git branch?
- How to pull a specific branch from Github
- Make an existing Git branch track a remote branch?
- Why do I have to “git push –set-upstream origin
“? - How to get the current branch name in Git?
- How do you create a remote Git branch?
- master branch and ‘origin/master’ have diverged, how to ‘undiverge’ branches’?
- Branch from a previous commit using Git
- git pull from master into the development branch
- Your configuration specifies to merge with the
from the remote, but no such ref was fetched.? - Set up git to pull and push all branches
- How do I clone a single branch in Git?
- how to reset develop branch to master
- How do I run git log to see changes only for a specific branch?
- How can I delete all Git branches which have been merged?
- How do I delete a Git branch locally and remotely?
- What is git tag, How to create tags & How to checkout git remote tag(s)
- Difference between “git add -A” and “git add .”
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- What is the best (and safest) way to merge a Git branch into master?
- Squash my last X commits together using Git
- How to apply a patch generated with git format-patch?
- Abort a Git Merge
- How to delete a remote tag?
- Updates were rejected because the tip of your current branch is behind its remote counterpart
- What does “Changes not staged for commit” mean
- git: fatal: Could not read from remote repository
- Git push results in “Authentication Failed”
- Download single files from GitHub
- How do I update Homebrew?
- Git error when trying to push — pre-receive hook declined
- Ignoring directories in Git repositories on Windows
- How can I merge multiple commits onto another branch as a single squashed commit?
- Gitignore not working
- Could not open a connection to your authentication agent
- How to get just one file from another branch?
- git checkout a single file from another branch and put in different folder
- Update Git branches from master
- Stash only one file out of multiple files that have changed with Git?
- How to find my GitHub username so that I can be found via the URL?
- Create a branch in Git from another branch
- What is HEAD in Git?
- What are the differences between git remote prune, git prune, git fetch –prune, etc
- How can I git stash a specific file?
- What does git rev-parse do?
- git – pulling from specific branch
- How to name and retrieve a stash by name in git?
- GitHub: invalid username or password
- Stash just a single file
- Stash just a single file
- Git – Ignore node_modules folder everywhere
- How to undo ‘git reset’?
- fatal: Not a valid object name: ‘master’
- Git and nasty “error: cannot lock existing info/refs fatal”
- How do I delete a local repository in git?
- Clone A Private Repository (Github)
- Throw away local commits in Git
- Hard reset of a single file
- How to remove remote origin from a Git repository
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- How to clone a specific Git tag
- How to git add a whole folder
- Git how to clone with SSH key, username
- Heroku: How to change a Git remote on Heroku
- Updates were rejected because the remote contains work that you do not have locally
- Undoing a ‘git push’
- What’s the significance of the “No newline at end of file” log?
- Git update submodules recursively
- Do a “git export” (like “svn export”)?
- What does git push origin HEAD mean?
- How do I set up Eclipse/EGit with GitHub?
- Repository size limits for GitHub.com
- git push origin master does not work
- How to permanently remove few commits from remote branch
- Rebasing remote branches in Git
- Git clone verbose output?
- Could not create work tree dir ‘example.com’.: Permission denied
- How to answer the git prompt in npm init for a local repo
- Add all files to a commit except a single file?
- failed to push some refs to [email protected]
- Git says “Automatic merge failed”, what does it mean?
- git pull remote branch cannot find remote ref
- How to configure git bash command line completion?
- How do I change the default location for Git Bash on Windows?
- How to stop tracking and ignore changes to a file in Git?
- Does running git init twice initialize a repository or reinitialize an existing repo?
- Eclipse EGit Checkout conflict with files: – EGit doesn’t want to continue
- WordPress with Git
- WordPress and Git – What folders should I track?
- Multiple copies of the same website: how to organize code/architecture?
- Pull latest stable release via git [closed]
- Why do the Roots theme CSS files not load (404)?
- Version control with a team of non-developers
- Painless way to track remote Git repo for WordPress updates
- WordPress on git – need help with configuration