Module 2: Git Assignment - 1
Tasks To Be Performed:
- Based on what you have learnt in the class, do the following steps:
a.Create a new folderb.Put the following files in the folder
- Code.txt
- Log.txt
- Output.txt
c.Stage the Code.txt and Output.txt filesd.Commit theme.And finally push them to GitHub- Please share the commands for the above points
- I create a new folder:
mkdir GitAssignment- I navigate to the new folder:
cd GitAssignment- I create the required files in this folder:
touch Code.txt Log.txt Output.txt- I initialize a new Git repository in this folder:
git init- I stage
Code.txtandOutput.txtfor the commit:
git add Code.txt Output.txt- I commit the staged files with a message:
git commit -m "I added Code.txt and Output.txt files"- I have already set up the remote repository:
- I’ve previously created a repository on GitHub named
GitAssignment. - I’ve also configured SSH, enabling me to clone and push to the repository without entering my credentials each time.
- I link my local repository to the remote GitHub repository:
git remote add origin git@github.com:hectorproko/GitAssignment.git- I rename the default branch to
main:
git branch -M mainGitHub repository’s default branch is already named main
- I push my commit to the remote GitHub repository:
git push -u origin mainSuccess
Now, I’ve successfully added my files to the GitHub repository.
![]()
