Simple view of add file into git repository
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
How to add File in Git repositery or import project into Git ?
- Install Git, use git-bash and goto git directory into git-bash by:
- $ cd c:/git
- Now open ‘Git-hub’ in browser or software and just create a ‘new’ repository by clicking create repository with new repository name. you can add readme file. This ‘repository folder’ is to be showing on git directory.
- github/login
- Now open git-base and enter the two commands one by on:
$ git config --global user.name "your-name"
$ git config --global user.email "your-mail"
- Now copy the path of “url” of repository from github and paste with command:
$ git clone your_url
- Now the repo clone file copied in your git directory, you can see by ls command:
$ ls
- Now the repo clone file copied in your git directory, you can see by ls command:
$ git add your_file
- And check it status by:
$ git status
- When you want to commit file in your git, you just enter the command:
$ git commit -m "commit" your_file
- At the end, complete object set up by the command:
$ git push -u origin main
Finally, we commit the files into your repository, this is basic view of git repository.