Data science class -007

 Github  SCM

 



 github Branching strategy -

curl commands

1) Curl , Access token , do create from settings

 'curl -u fullstackdotai "Authorization:token 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https://api.github.com/users/fullstackdotai/repos

 FullstackRepo

 2)

python github1.py

==========
import requests
import json

User = input("Enter the name of the User you want to print repository list of : ")
url = "https://api.github.com/users/{}/repos".format(User)

data = {"type" : "all" , "sort" : "full_name" , "direction" : "asc"}

output = requests.get(url,data=json.dumps(data))


for i in output.json():
    print(i["name"])

>> python github1.py

password:
 

 

 

 

What is Git,github,githubdesktop ?

1. Repository Setup:

     git init:

      This command creates a new Git repository in the current directory. This is the first step to start version control for your project.

 

    git clone https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL: This command clones an existing Git repository from a remote location (like GitHub or a server) to your local machine.

 

2. Tracking Changes:

 

    git add [file]: This command adds a specific file or directory to the staging area, which tells Git that you want to include these changes in the next commit.

 

    git commit -m "[message]": This command captures the current state of the files in the staging area as a commit. The -m flag lets you specify a commit message describing the changes.

 

    git status: This command shows the status of your working directory, indicating which files are modified, staged, or untracked.

 

3. Inspecting History:

 

    git log: This command displays the history of commits made to the repository. It shows information like commit message, author, and date.

 

    git show [commit hash]: This command displays details of a specific commit, including the commit message, changes introduced in that commit, and the commit hash (unique identifier).

 

4. Branching and Merging:

 

    git branch [branch name]: This command creates a new branch with the specified name. Branches allow you to work on different versions of your project independently.

 

    git checkout [branch name]: This command switches you to a different branch. You can work on the files associated with that branch.

 

    git merge [branch name]: This command combines the changes from one branch into the current branch.

 

5. Remote Repositories:

 

    git remote add [name] https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL : This command adds a remote repository (like GitHub) to your local repository. You can give it a nickname with the [name] placeholder.

 

    git push [remote name] [branch name]: This command pushes your local branch commits to the remote repository.

 

    git pull [remote name] [branch name]: This command fetches changes from the remote repository for a specific branch and merges them into your local branch.

 

6. Undoing Changes:

 

    git reset [commit hash]: This command allows you to undo changes made in a specific commit or later. Use with caution as it rewrites history.

 

    git rm [file] : This command removes a file from the staging area and your working directory.

 

# download and output to standard output
curl http://www.google.com

# -L: follow redirections (specified in HTTP Location Headers)
curl -L http://www.google.com

# -o <filename>: output to specific file
curl -L -o out.html http://www.google.com

# -O: output to filename based on url
curl -O http://cs229.stanford.edu/notes/cs229-notes1.pdf

# output to multiple file
curl -O <your-url> -O <your-another-url>

# -#: display progress bar while downloading instead of progress meter
curl -# -O http://cs229.stanford.edu/notes/cs229-notes1.pdf

# -C -: resume previous download by submitting somethings like ``Range: bytes=61440-`` in HTTP request header
curl -# -C - -O http://cs229.stanford.edu/notes/cs229-notes1.pdf

# --limit-rate <rate>: limit data transfer rate
curl --limit-rate 1000B -O http://www.gnu.org/software/gettext/manual/gettext.html

# -z <date(time)>: download only modified before/after specific time
curl -z -29-Sep-2012 -# -O http://cs229.stanford.edu/notes/cs229-notes1.pdf
# this will download only if modified before 29-Sep-2012

# download list of url
curl -C - -# -O http://cs229.stanford.edu/notes/cs229-notes[1-9].pdf

# -v, –trace: debug using verbose to inspect header
curl -v http://www.google.com

# -I/--head: fetch HTTP-header only
curl -I http://www.google.com

# custom protocol
curl dict://dict.org/show:db
curl dict://dict.org/d:google:foldoc

# -x <host>:<port>: using proxy
curl -x localhost:8000 http://www.google.com
 
 

 

Comments

Popular posts from this blog

AI Agents for Enterprise Leaders -Next Era of Organizational Transformation

Airport twin basic requirements

The AI Revolution: Are You Ready? my speech text in multiple languages -Hindi,Arabic,Malayalam,English