We gonna to see how to create a branch , add a file, change a file, make a commit, merge the branch and delete the branch all this with Git on github.
First we check if we are on Main branch
with :
git checkout
then we create a branch called feature_1
with
git branch feature_1
then we change to new branch with
git checkout feature_1
checking how many files we have
ls -l
after we push the new branch
git push --set-upstream origin feature_1
check on github
now we can edit the files
editing test.txt
we add new file test_3.txt
after we add the change and commit then push the change with GIt add and git commit
git add test_3.txt
git commit -m "add new file test_3 and change test"
then we pushed the changes with
git push
we forget the change on test.txt
git commit -a -m "change test"
git push
after i finish the change we have to merged the branch feature_1 to main
we have to change to main to merge
git checkout main
git merge feature_1
then we delete the branch and push the change
git branch -d feature_1
git push origin --delete feature_1
git push
Check on github
Leave a Reply
You must be logged in to post a comment.