diff --git a/README.md b/README.md index b17c62a..92ed9fa 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Have a read about [what is git](#so-what-is-git) first, this will help you under - [Sharing code](./commit.md) - [Learning to branch](./branches.md) - [Merging branches](./merging.md) - +- [Cheat Sheet](./cheat-sheet.md) (Useful commands) ## So what is Git? @@ -427,4 +427,4 @@ Now you're all ready to get started with learning how to use Git and we can star [](https://awscommunity.social/@Ric) [](https://gitlab.com/ric_harvey) [](https://www.linkedin.com/in/richarvey/)
Git Guide by Ric Harvey is licensed under CC BY-NC 4.0
\ No newline at end of file +[Git Guide](https://gitlab.com/ric_harvey/git-guide) by [Ric Harvey](https://awscommunity.social/@Ric) is licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1") \ No newline at end of file diff --git a/branches.md b/branches.md index 6874552..9d19b2b 100644 --- a/branches.md +++ b/branches.md @@ -143,4 +143,4 @@ Now if you check back in the web gui you'll see only the main branch exists. [](https://awscommunity.social/@Ric) [](https://gitlab.com/ric_harvey) [](https://www.linkedin.com/in/richarvey/)Git Guide by Ric Harvey is licensed under CC BY-NC 4.0
\ No newline at end of file +[Git Guide](https://gitlab.com/ric_harvey/git-guide) by [Ric Harvey](https://awscommunity.social/@Ric) is licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1") \ No newline at end of file diff --git a/cheat-sheet.md b/cheat-sheet.md index 39cbf15..a9a7a8b 100644 --- a/cheat-sheet.md +++ b/cheat-sheet.md @@ -1,56 +1,75 @@ -## Git Cheatsheet +## Git Cheat Sheet + +Here are a collection of useful git commands covered in this guide so far: + +#### Clone a Repository +``` +# Use SSH if you want to commit back HTTPS is fine for cloning +git cloneGit Guide by Ric Harvey is licensed under CC BY-NC 4.0
\ No newline at end of file +[Git Guide](https://gitlab.com/ric_harvey/git-guide) by [Ric Harvey](https://awscommunity.social/@Ric) is licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1") \ No newline at end of file diff --git a/getting-code.md b/getting-code.md index 01b8500..7544eef 100644 --- a/getting-code.md +++ b/getting-code.md @@ -104,4 +104,4 @@ Now you can change directory into that new folder and start working. [](https://awscommunity.social/@Ric) [](https://gitlab.com/ric_harvey) [](https://www.linkedin.com/in/richarvey/)Git Guide by Ric Harvey is licensed under CC BY-NC 4.0
\ No newline at end of file +[Git Guide](https://gitlab.com/ric_harvey/git-guide) by [Ric Harvey](https://awscommunity.social/@Ric) is licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1") \ No newline at end of file diff --git a/merging.md b/merging.md index 376801a..f6c3548 100644 --- a/merging.md +++ b/merging.md @@ -1,13 +1,13 @@ # Bringing code back together -Merging is a way of getting code from one branch to another, thats to say taking the changes from say the develop branch and bringing those into the main branch for example. You can do merge requests (pull requests on Github) either via the CLI or in the web gui. Lets take a look at the web gui first. +Merging is a way of getting code from one branch to another, that's to say taking the changes from say the develop branch and bringing those into the main branch for example. You can do merge requests (pull requests on Github) either via the CLI or in the web GUI. Lets take a look at the web GUI first. ## Merge Requests in Gitlab -We'll use our example of having a branch called **issue 99**. The first thing we need to do is push some code changes to that branch. This effectively moves the HEAD of the branch (issuse 99) forward from the point it was first split. Git now knows theres changes and it's ahead. You'll get a message like this in Gitlab when you commit the code and view the branch: +We'll use our example of having a branch called **issue 99**. The first thing we need to do is push some code changes to that branch. This effectively moves the HEAD of the branch (issue99) forward from the point it was first split. Git now knows there's changes and it's ahead. You'll get a message like this in Gitlab when you commit the code and view the branch: ![Message in Gitlab after pushing code to a branch](./img/create-merge.png) -Go ahead and click create merge request. You'll now see a commit message that shows you whats changing and it'll use data from the commit message to populate the merge request. +Go ahead and click create merge request. You'll now see a commit message that shows you what's changing and it'll use data from the commit message to populate the merge request. ![Merge request ready to go](./img/ready-merge.png) @@ -15,7 +15,7 @@ Now if you have merge conflicts instead of it saying **Ready to Merge** you'll h Now hit the blue merge button and you'll get the notification: -![Merge COmpleted](./img/merged.png) +![Merge Completed](./img/merged.png) You're all done, the code is merged and if you opted to delete the source branch you'll now be back to having just the one branch in your repository which is called main. @@ -83,7 +83,7 @@ In order to do this you need to get the commit hash, which in Gitlab can be foun ![Commit hash](./img/commit-hash.png) -When you identify the commit witht he changes you want run the following commands: +When you identify the commit with the changes you want run the following commands: ```bash git checkout target_branch @@ -91,7 +91,7 @@ git cherry-pickGit Guide by Ric Harvey is licensed under CC BY-NC 4.0
\ No newline at end of file +[Git Guide](https://gitlab.com/ric_harvey/git-guide) by [Ric Harvey](https://awscommunity.social/@Ric) is licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1") \ No newline at end of file