![]() ![]() If you like this blog, please do show your appreciation by giving thumbs ups and share this blog and if you feel, give me suggestions on scope of improvements. However If you have any doubt, feel free to contact me at References If you are the French Fry Fanatic change to the frenchfry branch via the following command. git merge - Combine a branch into the current checked out branch (i.e. git checkout - A way to move across the git commits and branches. If you are the Pizza Party Lover change to the pizza branch via the following command. git branch - An individual line of commit history that contains files that may differ from other branches. Git checkout main then git merge feature/demo In git you can have many branches as you want to split your code into multiple versions. Switch to main branch and Merge with main branch The easiest way to switch branch on Git is to use the git checkout command and specify the name of the branch you want to switch to. Git push –set-upstream origin feature/demo Let’s discuss few git commands Cloning a repository Rebasing in Git is a process of integrating a series of commits on top of another base tip. Branching in Git looks like this: Rebasing. As we start making commits, this master branch keeps updating and points to the last commit made to the repository. These commands are very useful when you want to contribute to some one’s or you own repository by applying your ideas into the code base. On creating a Git repository, by default, we are assigned the master branch. In sum, to delete remote branches that are merged, we can use the following command.Hi Readers, In this blog we will be looking about few important GIT commands that becomes very handy in our day to day development routine. The above two commands can be combined into a single command as follows: git branch -r -merged | egrep -v "(^\*|master|main|develop)" | xargs -n 1 git branch -dĪ branch can be deleted from a remote using the following command: git push -delete origin branchname To delete the branches locally, we use: git branch -d branch-name git branch -r -merged| egrep -v "(^\*|master|main|develop)" Here, master, main, and develop are excluded. The following command is used to list the local branches that are merged. There are two steps to delete Git local branches that are merged, as follows:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |