linux:git

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:git [2019/10/05 19:33] – [Atom, Git and Rust] mhlinux:git [2020/06/01 16:35] (current) – external edit 127.0.0.1
Line 33: Line 33:
 git init //Skip if in a Rust project created with cargo, git is already initialized git init //Skip if in a Rust project created with cargo, git is already initialized
 git remote add origin <remote_repo_url> git remote add origin <remote_repo_url>
-git add . //Not sure it'required, since the folder is already populated.+git add . //required
 git commit -m "Initial commit" //Feel free to change the message git commit -m "Initial commit" //Feel free to change the message
 git push -u origin master //This is what actually pushes. git push -u origin master //This is what actually pushes.
Line 47: Line 47:
 git push --all --set-upstream origin  git push --all --set-upstream origin 
 </code> </code>
 +
 +==== Branching ====
 +//The following is still under test and uncertain, but seems to have worked already. The commands are probably not optimized (i.e. git pull calls git fetch already so it may not be required, but this needs additional testing to clear out//
 +
 +
 +When creating another branch, to have it appear in Atom run the following command :
 +
 +<code>
 +git fetch origin
 +</code>
 +
 +This will fetch all the data in the origin's repository, which should be your remote repo if everything is configured correctly.
 +
 +Then run :
 +
 +<code>
 +git pull origin <name-of-branch>
 +</code>
 +
 +This should update the local repository to the current tip of the head from the branch you are pointing to.
 +
 +If this does not work, maybe it is required to create the branch in atom with the "new branch" button with an identical name but I doubt so.
 +
  
  
  • linux/git.1570296821.txt.gz
  • Last modified: 2020/06/01 16:35
  • (external edit)