These are a few notes I took when I needed to learn git a few months ago so I decided why not publish them here. I got my notes from this YouTube Video by Jake@Linux
Make sure you make a new folder for your project then once you cd into the directory. You can then do git init
or git init
project directory
git add .
git add
You are able to do git add ExampleFile1 Examplefile2
and that works fine but you can also git add -p
which will provide you with a status
Then you can say yes or no to staging the hunk which is just asking if you want to push it to your repo.
git commit -m "The commit name hehehe"
git push [url or ssh thingy]
will push your changes to the git repository.
To check all the branches in a repository do git branch
Creating a new branch all you have to do is git branch TheNameofTheBranchHere
To push the branch to the repository do the command: git checkout TheNameofTheBranchHere