Tag: git-branch

67 votes
30 answers
2.7K views
Git fetch remote branch

My colleague and I are working on the same repository. We've branched it into two branches, each technica

avatar
Brianne
0 1 0 9
asked 07 September, 2021
48 votes
30 answers
513 views
How to get the current branch name in Git?

I'm from a Subversion background and, when I had a branch, I knew what I was working on with "These worki

avatar
Santiago
0 1 0 9
asked 07 September, 2021
58 votes
24 answers
515 views
How do you create a remote Git branch?

I created a local branch which I want to 'push' upstream. There is a similar question here on Stack

avatar
Rudy
0 1 0 9
asked 07 September, 2021
59 votes
9 answers
543 views
Move existing, uncommitted work to a new branch in Git

I started some work on a new feature and after coding for a bit, I decided this feature should be on its own b

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
57 votes
7 answers
2.4K views
How do I clone a specific Git branch?

Git clone will behave copying remote current working branch into local. Is there any way to clone a

avatar
Tuan
0 1 0 9
asked 07 September, 2021
58 votes
22 answers
3K views
Make an existing Git branch track a remote branch?

I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remo

avatar
Sena
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
2K views
How to clone all remote branches in Git?

I have a master and a development branch, both pushed to GitHub. I've cloned, pulled, and fetched, but I

avatar
Percy
0 1 0 9
asked 07 September, 2021
58 votes
16 answers
371 views
How do I push a new local branch to a remote Git repository and track it too?

I want to be able to do the following: Create a local branch based on some other (remote or local) branch (via

avatar
Roger
0 1 0 9
asked 07 September, 2021
62 votes
15 answers
2.9K views
Move the most recent commit(s) to a new branch with Git

I'd like to move the last several commits I've committed to master to a new branch and take master b

avatar
Dwain
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
2.1K views
How to remove local (untracked) files from the current Git working tree

How do you delete untracked local files from your current working tree?

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
1.6K views
How do I rename a local Git branch?

I don't want to rename a remote branch, as described in Rename master branch for both local and remote Gi

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
2K views
How do I delete a Git branch locally and remotely?

I want to delete a branch both locally and remotely. Failed Attempts to Delete a Remote Branch $ git branch -d

avatar
Corey
0 1 0 9
asked 07 September, 2021