git
git
Project setup
creating a version
We use
It’s important to have your name and email so that if you were to add a version that
crashes the system. Your team mates will know who broke it
When we ran git add . the changes were saved in Staged Changes( staging area)
o Staging area - Changes here will go to the next version
o Under the staging area is all the changes we are working, we haven’t used git
add . (Working Area)
Taking changes out the staged area press the – sign button
o back to version 2
C:\Users\TSHEPO\Desktop\git-tutorial> git log --all
shows all the previous versions of the code
When you want to ignore a file from going to the next version
1. Go to your profile at github then press repository furthermore press new then pick the folder
you want to add
2. Upload local repository to remote repository on powershell we –
PS C:\Users\TSHEPO> cd ~/Desktop/git-tutorial
3. Create a link between the local and remote repository
PS C:\Users\TSHEPO> cd ~/Desktop/git-tutorial/ git remote add origin
https://github.com/A-PULE/git-tutorial.git
o Origin – is the nickname for the file
o The link is a HTTPS link from github
To check if you have created the link between the 2
o PS C:\Users\TSHEPO> cd ~/Desktop/git-tutorial/ git remote
Shows the nickname
o PS C:\Users\TSHEPO> cd ~/Desktop/git-tutorial/ git remote –v
Shows the link
Origin/master is a remote tracking branch, tells us how the master branch looks like in origin
When we add a new commit “Version 11”
We have an existing project, we want to intergrate git and upload to github (git was never
involved in this project)
1. Git init(turn it into a git repository)
2. Create a commit
3. Create a github repository
4. Git push
We are starting a new project, we want the project to be on github
1. Create some code
2. Git init
3. Create a commit
4. Create a github repository
5. Git push
- What we have been doing
Or….