Friday, February 14, 2020

Quick Commands to explore GitHub



Get your GitHub Repo on your local

1. Create a folder for your repo
2. git init (initialize the git repo for local)

3.git remote add fork https://github.com/kalaiarasansubramanian/practice.git
  fork is the local repo label. Bind remote repo to your local repo.practice.git is the remote repo
Checkout from the head revision..bring all latest and default is the master branch 

4. git checkout master
5. git fetch fork
6. git reset --hard fork/master
HEAD is now at 1afb284 Merge pull request #1 from menaka2204/new-practice
7. touch test4
8. git add .
9. git commit -m "test4 file added"
10. git push https://username:password@github.com/kalaiarasansubramanian/practice
Above pushes to remote repo on master branch
11. Create a pull request to push the forked repo code to the original repo
12. On original repo, pull request can be approved and merged

No comments:

Post a Comment