This is useful if you are using branches and pull requests. Like pull, you can push to a specific remote and branch with: git push name-of-remote name-of-branch. By default, this will push to the origin remote’s master branch. git push pushes your local changes up to your remote.To be specific about which remote and branch to pull from, you can use: git pull name-of-remote name-of-branch By default, this will pull from the origin remote’s master branch. git pull once you’ve committed all your local work and running git status shows that you have nothing to commit, you pull down any changes from your remote.“Final commit” is not the commit message you’re looking for exactly 100% of the time. It’s important to write a brief, clear commit message so you know what each commit is for. git commit -m "write commit message here" commits all staged work.You can also specify a particular file to stage with git add file-path/name-of-file takes all unstaged work and stages it, making it ready to be committed. The v stands for verbose, which shows you the URL of the repository on github, if any, that your local repository is pointing to rather than just the name of the remote repo. git remote -v shows you all the remotes for your repo.git diff shows you the changes in your unstaged code.It will show you if you have any work that is unstaged, what branch you are on, how many commits you are ahead of the master remote on github, and other useful things. git status shows the current status of your repo.You must run this before you can commit any of your work. git init initializes your local directory as a new git repository.Here is a summary of the commands you’ll use most often: There are hundreds of different Git commands, but to get started you only need to remember a handful of them.
0 Comments
Leave a Reply. |