Creating a Repository on GitHub:
------------------------------------------
1. Sign in to GitHub
2. Click the "+" sign beside your profile and click "New Repository"
3. Provide repository name and other necessary things if needed.
Pushing Code/project folder into GitHub Repository:
-------------------------------------------------
1. Go to the project location on your pc/laptop.
2. Enter into the Project.
3. Right click on mouse and select "Git Bash Here"
4. Run the following commands SEQUENTIALLY -
git init
git add -A (add your files)
git status
git commit -m "Your Message" (commit locally)
git remote add origin GITHUB HTTPS PROJECT LINK
HERE (add your origin)
git remote add origin https://github.com/yourprofile/yourproject.git
git push -u origin master (push it upstream)
5. Login popup window will appear to log into GitHub.
Congratulations! You have pushed your code in Github public repo !!!!!
For each new change from Onward:
----------------------------------------------
1. git status
2. git add -A
3. git commit -m "Commit Message is here"
4. git push -u origin master
------------------------------------------
1. Sign in to GitHub
2. Click the "+" sign beside your profile and click "New Repository"
3. Provide repository name and other necessary things if needed.
Pushing Code/project folder into GitHub Repository:
-------------------------------------------------
1. Go to the project location on your pc/laptop.
2. Enter into the Project.
3. Right click on mouse and select "Git Bash Here"
4. Run the following commands SEQUENTIALLY -
git init
git add -A (add your files)
git status
git commit -m "Your Message" (commit locally)
git remote add origin GITHUB HTTPS PROJECT LINK
HERE (add your origin)
git remote add origin https://github.com/yourprofile/yourproject.git
git push -u origin master (push it upstream)
5. Login popup window will appear to log into GitHub.
Congratulations! You have pushed your code in Github public repo !!!!!
For each new change from Onward:
----------------------------------------------
1. git status
2. git add -A
3. git commit -m "Commit Message is here"
4. git push -u origin master
================== day to day used commands ================
git checkout master
git pull origin master
git merge <the branch that you want to merge with checkout branch>
git push origin master
----------------------------
1. On your branch:
git pull origin master
git merge <the branch that you want to merge with checkout branch>
git push origin master
----------------------------
1. On your branch:
git fetch && git rebase origin/master
// it does the same action as the 'rebase' button on web view; or CLI version of rebase with master.
// it does the same action as the 'rebase' button on web view; or CLI version of rebase with master.
git push origin branch_name -f
2. merge your branch with 'fast-forward only' options
checkout master
git fetch && git pull
// up-to-date local master with origin master
// up-to-date local master with origin master
git merge origin/<YOUR BRANCH> --ff-only
git push origin master -f
// if we do push on master directly
// if we do push on master directly
Comments
Post a Comment