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


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
git push --set-upstream origin

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"
git add

then we pushed the changes with

git push
git push

we forget the change on test.txt

 git commit -a -m "change test"
git push
 git commit -a -m

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
git merge

then we delete the branch and push the change

 git branch -d feature_1
 git push origin --delete feature_1
git push
git branch -d

Check on github






One response to “GIT”

  1. Pelayo Avatar

    This has been very useful for me, thanks very much!!

Leave a Reply

Your email address will not be published. Required fields are marked *