git branch code example
Example 1: git branch
git checkout -b # create a new branch
git switch # Switch branch
Example 2: git branch
$ git checkout -b iss53
Switched to a new branch "iss53"
Example 3: git branch
git checkout -b
Example 4: git branch
git checkout -b
Example 5: git branch
git rm file.java
git commit -m "removing"
git push origin master
git branch BranchName :- Creating branch
git branch :- checking branch master
git checkout BranchName :- name is a branch name where you want to switch
git branch -d BranchName :- deleting brach on local
git push origin : deletedBranchName :-
deleting Branch deteled on local(intellij) from Remote(gitHub WebSite)
git branch -a :- Cheking all branchs even deleted on Local (but not in remote)
git checkout -b BranchName :- Creating branch and Switching to the new branch
git merge BranchName :- Merging branch
git push --set-upstream origin BranchName :-
Pushing branch to remote (gitHub WebSite) from local (intellij)
git fetch origin BranchName :-
Pulling branch to local (intellij) from remote(github WebSite)
git push origin branch1:branch2
git pull origin branch1:branch2
Example 6: git branch
$ git branch iss53
$ git checkout iss53