Repository files navigation
created a new branch and switched to that branch
git checkout -b main
Created a new file
touch b.txt
performed git add and commit with commit name.
git add .
git commit -m "Commit message"
Added one more commit using the same command as 3.
git checkout master
To check all the commits
git log
merge main commit with master commit
git merge main
git log
Created one more commit
git add .
git commit -m "Commit message"
git checkout master
git add .
git commit -m "Commit message"
Added one more commit using the same command used in 10.
git checkout master
To check all the commits
git log
merge main commit with master commit
git merge main
git log
created a new branch and switched to that branch
git checkout -b main1
created a file
touch c.txt
Added and commited
git checkout master
Commited again
git checkout main1
git rebase master
updated text file
To restore the changes git stash
To check the changes made git stash pop
git stash list
one more commit on a.txt
git add .
git commit -m "Commit message"
git checkout main
one more commit on b.txt
git add .
git commit -m "Commit message"
Taking the commit id using git log
git checkout master
git cherry-pick commit-id
git checkout master
git log
created multiple stash in a single branch(main) using
git stash
to pop up a particular stash
git stash apply stash@{1}
You can’t perform that action at this time.