. |
Pipeline Script Fundamentals
Click Here : DevOps Related Posts
Check GIT commands for Interview preparation SET-1:
GIT Interview Question 1 to 11
Check GIT commands for Interview preparation SET-2:
GIT Interview Question 12 to 21
Check GIT commands for Interview preparation SET-3:
41. How to push code to existing remote branch in Github? Push your branch to the remote repository: 42. How do I force git pull to overwrite the local file changes? Note: If you have local unpushed commits this will remove them from your branch! First, run a fetch to update all origin/<branch> refs to latest:(downloads the latest from remote without trying to merge or rebase anything) git fetch --all Backup your current branch: git branch backup-master Then, you have two options: git reset --hard origin/master OR If you are on some other branch: git reset --hard origin/<branch_name> //git reset resets the master branch to what you just fetched. //The --hard option changes all the files in your working tree to match the files in origin/master WHY AUTOMATION QA SHOULD LEARN GIT? Git is a powerful version control system that allows developers to manage changes to their codebase. Although Git was originally designed for software development, it has become an essential tool for automation testing as well. Here are some reasons why learning Git is important for automation testing:
Overall, Git is an essential tool for automation testing because it allows you to manage changes to your test code, collaborate with other testers, integrate with CI tools, and review code changes. Learning Git will make you a more efficient and effective automation tester. 43. Difference between soft, mixed, and hard resets? 44. How to undo a git merge with conflicts? The solution is quite dependent on the version of GIT you are using. Latest Git Version: git merge --abort This attempts to reset your working copy to whatever state it was in before the merge. Prior to version 1.7.4: git reset --merge This is older syntax but does the same as the above. Prior to version 1.6.2: git reset --hard How to integrate Maven project with Jenkins? ANS: Maven & Jenkins Integration 45. What does cherry-picking a commit with GIT means? Ans: Let's Consider the following scenario. You have two branches. a) release2 - This branch is going to your customer, but there are still some bugs to be fixed. b) master - Classic master branch, where you can for example add functionality for release2. NOW: You fix something in release2. Of course you need this fix also in master. And that is a typical use-case for cherry picking. So cherry pick in this scenario means that you take a commit from release2 branch and include it into the master branch. 46. Difference between rebase and merge? 47. How to delete a branch from local and remote? To delete a local branch you can use below command git branch -d the_local_branch To remove a remote branch: be careful while doing this as it will delete a remote branch! git push origin :the_remote_branch or use the new syntax (v1.7.0)
48. How to recover the dropped stash in GIT? Ans: If you know the hash of the stash commit you have dropped, you can apply it as a stash: git stash apply $stash_hash 49.How to create repository in bitbucket and push code for automation project? 50. What is the meaning of git conflict markers? VERY VERY IMP Ans: Let's assume that after we pulled from remote branch, we got conflict, when we open the file it looks something like below: <<<<<<< HEAD:file.txt Hello world ======= Adios Amigos >>>>>>> 77976da35a11db46586:file.txt A. The lines between the lines beginning <<<<<<< and ======here: <<<<<<< HEAD:file.txt Hello world ======= This above is what we already had locally - you can tell because HEAD points to your current branch or commit. B. The lines between the beginning ======= and >>>>>>>: ======= Adios Amigos >>>>>>> 99976da35a22db46586:file.txt This is what was introduced by the other (pulled) commit, in this case 99976da35a22 51. Command to delete the file from your working directory and stages the deletion? REVISON:32. How to rename a branch in GIT while working on it? We can use the below command for renaming of the branch: git branch -m <new name> Click Here : DevOps Related Posts 33. If we want to rename the branch from outside the branch then how we can do it? git branch -m <old name> <new name> 39. How to track the remote branches in GIT? Assuming there is a remote repository that you cloned your local repository from and also assuming that there is a branch named 'remote_branch' on that remote repository, here is how to track it locally: # list remote branches git branch -r # start tracking one remote branch git branch --track remote_branch origin/remote_branch 40.How to create repository in bitbucket and push code for automation project? ******************************************************************* For any doubts or career guidance, arrange a 1:1 call with me https://topmate.io/sidharth_shukla ******************************************************************** Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session TRANING VIDEOS AVAILABLE with Live Doubt Session @4500/-(course-1 below, API TRaining Videos With ClassNotes and Coding Set) and 6500/- (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122 Entire course content can be found below: COURSE CONTENT Check GIT commands for Interview preparation SET-1: GIT Interview Question 1 to 11 Check GIT commands for Interview preparation SET-2: GIT Interview Question 12 to 21 Check GIT commands for Interview preparation SET-3: ************************************************* SeleniumWebdriver Automation Testing Interview Questions: https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver API Testing Interview Question Set:
|
No comments:
Post a Comment