Git: Pushing the changes:

2 Minute Blogs

Vipul Krishna Mathuria
2 min readSep 15, 2020

git init: initialize an empty repo

git clone <link to the repo>: cloning the repo

touch newfile.txt: create newfile.txt

Now edit the file and ctrl+Y then choose Y

git add newfile.txt: changes moved to the staging area

git commit -m “Add text in the file”: changes moved to local

git push -u origin: for pushing code to remote

changes can be seen in the UI of GitHub or GitLab

change the text in this file by UI of GitHub or Gitlab and Commit the change by UI of GitHub or GitLab

change the text in newfile.txt by editors in your machine

git add newfile.txt

git commit -m “Update newfile.txt”

git push -u origin

Got Error! : Because commit is done by the UI is blocking us

git pull origin: This command puts the text of both commits at one place and lets us choose out of these

choose which changes you want to keep: By Option shown above and below on the different texts from both commits

git add newfile.txt

git commit -m “take care of outside commits”

git push -u origin

Successful Push

Do you want to learn a concept in digestible Bytes then Don’t wait and head over to the Git Byte By Crio Absolutely Free.

And this to check out how many bytes is available free for you.

--

--

Vipul Krishna Mathuria

I am a final year Undergraduate of Computer Science B- Tech in NIT Jalandhar. Softwares fascinated me from my early adulthood.