Featured

Steps to Create a Project on GitHub

Steps to create a project on GitHub: 

1.  Start a repo on GitHub

2.  Make a README.md file

3.  Open vs code – new folder – new terminal – git clone http:…. (from the repo).

4.  In terminal – cd theprojectname  à move into the project file

5.  Ls -la is for showing hidden file à not working for me ????

6.  Make some changes to README file, in terminal git status à shows all the changes on the file

7.  To add all changes update to the folder à git add . (the dot . means all changes to be added)

8.  Add a new file index.html, in terminal à git commit -m “title of commit” -m “description of commit”

9.  Then git push origin master

10.                ****Initial a repo in local text editor à git init

11.                After use git add . etc, when pushing, go to github, create an empty samename repo, copy SSH address, back to terminal, git remote add origin gitxxxx (the ssh address)

12.                Check if fetched the remote repo à git remote –v

13.                Now you can push à git push origin master OR git push -u origin master, then later on for git push, just use “git push” alone

14.                *** switch to a new branch à git checkout -b new-branch-descriptive-name

15.                à git branch : display all branches, with the current branch start with a “*” à git checkout is to switch between branches

16.                After modified in a certain branch, git status à git add . ( or git add theModifiedFileName) à git commit -m “title” -m “description”

17.                Before merge to master branch, à git checkout master (move to master branch, then compare if you like) àgit diff theBranchName

18.                Back to theMordifiedBranch, git status à git add . à git commit -m “title”     if needed, then à git push à copy the prompted line of command redo the push branch à do pull request on github àdelete the branch

19.                Back to terminal à git checkout master àgit pull origin master    to pull all the updates from github to local terminal à git branch -d theBranchNameThatNeedToBeDeleted, to delete the branch

20.                For merge conflict *** à https://www.youtube.com/watch?v=RGOj5yH7evk&ab_channel=freeCodeCamp.org after 50minutes for conflict, undo one or more commits

 


Popular Posts