GITHUB - Creating a Repo

    

HOW TO MAKE A GIT REPO INTO AN ORDINARY FOLDER 1) Simple : Remove the .git file inside the folder 2) Use ls -a to view the hidden files 3) Remove it using sudo rm -rf .git 4) Hooray, it's no more a git repo. Time to Smile HOW TO MAKE A FOLDER INTO A GIT REPO FROM COMMAND PROMPT 0)Create a repo in your github page : Top right corner "+". Give name, public/private, create a README file and give create. Check under "CODE" - the place where we clone the project check for the url under https ending with .git 1)In the command prompt, go to the directory for which you want to create the repo For Example : If Sample is the repo, let your command prompt be     Sample$ 2) Use the command     git init 3) Type the command

    git add . 4) Type the command
        git commit -m "first commit" 5) Type the command
        git remote add origin your_git_url_that_you_can_copy_from_git_with_.git


6)Type this     git push -u origin master 7) Make master branch as the default from the github page : Repo Settings(Wheel like symbol) -> Select Master branch. On the left Pane select 'Branches' and click the toggle icon to make master as the default branch and select "Update"

HOW TO CLONE A GIT REPO USING Personal Access Token 1)In the GitHub Page, Under your profile image at the top right corner , expand the menu. Click Settings over there. 2)In the left pane, there is "Developer Settings" at the bottom. Select it 3)Select Personal Access Tokens in the left most pane 4) Click Generate New Token 5) Copy the token and create a url like this
https://<your_git_account_user_name>:<Personal Access Token>@github.com/<your_git_account_user_name>/<your_git_repo_name>.git
6) Use the command git clone the_url_created_in_step5 HOW TO SWITCH BETWEEN BRANCHES/ CHANGE A BRANCH git checkout <branch-name>



Comments

Popular posts from this blog

INSTALL GIT IN CENTOS 7

Find go version?

Go : Why 'main' function and why 'main' package